Skip to content

Commit 7cc537b

Browse files
committed
Add file size limit for presigned posts
1 parent f99de03 commit 7cc537b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

styleguide_example/integrations/aws/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ def s3_generate_presigned_post(*, file_path: str, file_type: str) -> Dict[str, A
8888
},
8989
Conditions=[
9090
{"acl": acl},
91-
{"Content-Type": file_type}
91+
{"Content-Type": file_type},
92+
# As an example, allow file size up to 10 MiB
93+
# More on conditions, here:
94+
# https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html
95+
["content-length-range", 1, 10485760]
9296
],
9397
ExpiresIn=expires_in,
9498
)

0 commit comments

Comments
 (0)