tedder / requests-aws4auth

Amazon Web Services version 4 authentication for the Python Requests module
MIT License
178 stars 63 forks source link

Include Content-MD5 in signed headers #17

Open USSRLivesOn opened 8 years ago

USSRLivesOn commented 8 years ago

Per the AWS docs, "The headers used for request signing are: content-md5, content-type, date, and anything that starts with x-amz-." It looks like content-md5 is excluded currently from the set of headers that is signed by requests-aws4auth, but it should be included. Our current workaround is just to pass the full set in include_hdrs kwarg, but would be good to have the defaults updated.

KatTraxler commented 1 year ago

I'm running into this issue now, can you provide an example of this workaround?

viniciuspinto commented 11 months ago

I'm running into this issue now, can you provide an example of this workaround?

I got it working by passing the include_hdrs argument to the constructor:

AWS4Auth('<ACCESS ID>', '<ACCESS KEY>', 'eu-west-1', 's3', include_hdrs={'host', 'content-type', 'date', 'x-amz-*', 'content-md5'})