[patch] 修正ks3问题
This commit is contained in:
@@ -83,18 +83,18 @@ def upload_installer(connection, installer_path):
|
||||
|
||||
key = bucket.new_key(ks3_key)
|
||||
|
||||
with open(installer_path, 'rb') as f:
|
||||
key.set_contents_from_file(
|
||||
f,
|
||||
headers={
|
||||
'Content-Type': 'application/octet-stream',
|
||||
'Content-Disposition': f'attachment; filename="{installer_path.name}"',
|
||||
'Cache-Control': 'public, max-age=3600',
|
||||
'x-kss-storage-class': 'STANDARD'
|
||||
}
|
||||
)
|
||||
|
||||
key.set_acl('public-read')
|
||||
# Upload file with public read permission (reference: bulk_upload_static_to_ks3.py)
|
||||
key.set_contents_from_filename(
|
||||
str(installer_path),
|
||||
headers={
|
||||
'Content-Type': 'application/octet-stream',
|
||||
'Content-Disposition': f'attachment; filename="{installer_path.name}"',
|
||||
'Cache-Control': 'public, max-age=3600',
|
||||
'x-kss-storage-class': 'STANDARD',
|
||||
'x-kss-acl': 'public-read' # Set public read permission in headers
|
||||
},
|
||||
policy='public-read' # Set ACL policy
|
||||
)
|
||||
|
||||
# Generate download URL (using HTTPS)
|
||||
protocol = 'https' if KS3_IS_SECURE else 'http'
|
||||
|
||||
Reference in New Issue
Block a user