mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Turn off bucket validation to minimize S3 permissions.
boto attempts to validate the bucket when calling get_bucket by doing a LIST with zero desired items. By turning off validate we can reduce the permissions.
This commit is contained in:
committed by
Ricky Ramirez
parent
e12dbdd046
commit
149567a797
@@ -41,7 +41,7 @@ def send_file(bucketname, filename, content, content_type='text/plain', never_ex
|
||||
# TODO: add ACL support instead of always using public-read
|
||||
|
||||
connection = S3Connection(KEY_ID, SECRET_KEY)
|
||||
bucket = connection.get_bucket(bucketname)
|
||||
bucket = connection.get_bucket(bucketname, validate=False)
|
||||
k = bucket.new_key(filename)
|
||||
|
||||
headers={'Content-Type': content_type}
|
||||
|
||||
Reference in New Issue
Block a user