Skip to content

Commit 166ffa0

Browse files
authored
Merge pull request #1 from Securezapp/patch-1
Fall back to default content type
2 parents 1ce6a2b + 0873be7 commit 166ffa0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/deployer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import shutil
1010

1111
s3 = boto3.resource('s3')
12+
defaultContentType = 'application/octet-stream'
1213

1314
def resource_handler(event, context):
1415
print(event)
@@ -53,6 +54,7 @@ def upload(lambda_src, target_bucket, acl, cacheControl):
5354

5455
def upload_file(source, bucket, key, s3lib, acl, cacheControl, contentType):
5556
print('uploading from {} {} {}'.format(source, bucket, key))
57+
contentType = contentType or defaultContentType
5658
s3lib.Object(bucket, key).put(ACL=acl, Body=open(source, 'rb'),
5759
CacheControl=cacheControl, ContentType=contentType)
5860

0 commit comments

Comments
 (0)