Last active
December 14, 2015 23:09
-
-
Save zbyte64/5163791 to your computer and use it in GitHub Desktop.
Fix cross origins on S3 with boto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from boto.s3.cors import CORSConfiguration | |
from boto.s3.connection import S3Connection | |
conn = S3Connection('<aws access key>', '<aws secret key>') | |
bucket = conn.create_bucket('mybucket') | |
config = CORSConfiguration() | |
config.add_rule(allowed_method=['GET'], allowed_origin=['*'], allowed_header=['Content-*', 'Host'], max_age_seconds=3000) | |
bucket.set_cors(config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment