-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Forcing content-type to 'application/octet-stream' breaks SQS requests. #9
Comments
Thanks for report! There reason for hard coding content-type was that in old version aiohttp there was no way to skip it. aiohttp simply added this header before sending request. When botocore calculates signature, content type is not present but added later, this leads to 403 error due to wrong signature. New aiohttp has a way to skip auto generated headers aio-libs/aiohttp#507 so I need update aiobotocore to use this features. I have never tested aiobotocore with SQS (only with s3), I glad to hear that it is working :) |
Obmarg's patch appears to work with SQS but breaks S3 (I get a SignatureDoesNotMatch error on S3 PutObject operations). |
This seems to have fixed SQS support - thanks! |
I've been trying to get aiobotocore working with SQS, but was getting errors because the content-type being sent with the request was always set to
application/octet-stream
when SQS requiresapplication/x-www-form-urlencoded
.I've managed to track this down to these lines https://github.com/jettify/aiobotocore/blob/master/aiobotocore/endpoint.py#L105-L112 that hard-code
application/octet-stream
. I assume these were needed somehow for S3, but they stop the usual botocore content-type code from working. As far as I can tell, the content-type would usually be set in https://github.com/boto/botocore/blob/082a8b8e564b12500ff3de4d048f89d56d33d67d/botocore/vendored/requests/models.py#L460I've tried removing the
application/octet-stream
hard coding here and it does seem to fix SQS. I haven't thoroughly tested it though.The text was updated successfully, but these errors were encountered: