Using headers in presigned urls
See original GitHub issueHi guys!
I’m changing from boto2 and I’ve stopped in generation of presigned urls. With boto2 we can give headers to generate presigned urls, but with boto3 I didn’t found this option. I need to give a Content-Type header to upload a video with correct content type.
My actual code with boto2:
s3 = boto.connect_s3()
headers = [{'Content-Type': 'image/jpeg'}]
return s3.generate_url(7200, 'PUT', 'my-bucket', 'my-key', headers)
Am I missing something? There is a way to give headers to generate_presigned_url?
Thanks in advance!
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
s3 presigned url mandatory custom request headers
I am trying to generate a presigned url with some user data along with, as I understand I need to use custom request...
Read more >Using headers in presigned urls for S3 "get_object" methods.
I tried to append headers manually (create request_dict, add headers, call get_presigned_url method of requestsigner), but url is invalid. Now I ...
Read more >Creating Pre-Signed URLs for Amazon S3 Buckets
A pre-signed URL allows you to grant temporary access to users who don't have permission to directly run AWS operations in your account....
Read more >Dynamically set content-type headers for S3 presigned urls ...
Share All sharing options for: Dev tip: How to dynamically set content-type headers for S3 presigned urls with a native fetch request ·...
Read more >Securing your Amazon AWS S3 presigned URLs, tips and tricks
8. Using signed headers, you can add a file's hash and avoid uncontrolled file uploads ... As said before, once a presigned URL...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So there is no parameter for custom headers in boto3’s generate_presigned_url. The headers get added based on the parameters that you would normally pass to the client’s method. So something like this:
Hopes this helps.
Full situation. I create request to service with Content-Type header. After I redirect request to AWS S3 service(302 Redirect). And S3 check request and raise “SignatureDoesNotMatch” exception. With url, generated with old boto, all work correct. I created new issue https://github.com/boto/boto3/issues/610