Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does aiohttp support awss3? #474

Closed
zhouxiaojian1985 opened this issue Aug 27, 2015 · 3 comments
Closed

Does aiohttp support awss3? #474

zhouxiaojian1985 opened this issue Aug 27, 2015 · 3 comments

Comments

@zhouxiaojian1985
Copy link

I am testing to put an object to amazon s3. But get a 403 status code with reason
'The request signature we calculated does not match the signature you provided.
Check your key and signing method.'

The code is:

response = yield from aiohttp.put(url, data=open(pathfn, 'rb'), headers=headers)
logger.debug('response status is ' + str(response.status))
raw = yield from response.text()
logger.debug('response body is ' + str(raw))

The url is:
http://s3.amazonaws.com:80/bucket_name/key_name

The raw headers input is:
{
"User-Agent": "Boto/2.38.0 Python/3.4.0 Linux/3.13.0-46-generic",
"Content-Length": "1024",
"Date": "Thu, 27 Aug 2015 02:49:17 GMT",
"Authorization": "AWS [access_key]:[signature]"
}

But when test with requests. It returns 200 status code.
The code is:

response = requests.put(url, data=open(pathfn, 'rb'), headers=headers)
logger.debug('response status is ' + str(response.status_code))
logger.debug('response body is ' + str(response.text))

So does aiohttp inside will affect the header 'Authorization'?

@popravich
Copy link
Member

aiohttp support awss3, however there is a little problem with Content-Type header.
See #457 for details and possible solution.

@zhouxiaojian1985
Copy link
Author

@popravich: Thanks.
As awss3's signature is related with Content-Type header.
I explicitly set the Content-Type header and calculate awss3's signature with it.
Then it returns 200 status code from awss3.

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants