-
Notifications
You must be signed in to change notification settings - Fork 860
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
Async clients do not send host header when using anonymous credentials #1473
Comments
Hi @sworisbreathing, this was discussed a little here: #1407 (comment). While this is valid behavior according to the spec, I think we will go ahead and make this change as it's much less surprising for users of the library for the |
Hi @dagnir, it seems I've read the spec a bit differently than you have:
I'll admit I find the last sentence a bit confusing and contradictory to the rest of the spec, but it seems that the header needs to be sent all the time, but there are certain times when it can be empty. |
I've already opened #1478 which addresses this issue (at least partially) |
Thanks for the PR! I will have a look today. Hmm yes the points under 19.6.1.1 seem a little contradictory. Here is the part where the spec mentions the
|
Fixed by #1500 as well. |
Expected Behavior
All HTTP requests sent using HTTP 1.1 send a valid HTTP host header, unless explicitly overridden in the client configuration.
Current Behavior
When using the default SdkAsyncClient implementations with anonymous credentials, requests are sent using HTTP 1.1 but do not include the mandatory Host header.
Stepping through the code in a debugger session, it appears that the host header is being set by
AbstractAws4Signer
, but that logic is skipped inBaseAws4Signer.sign()
when anonymous credentials are used.Possible Solution
AmazonAsyncHttpClient.execute()
to set a default host header if none was specified, and/orSteps to Reproduce (for bugs)
Host
headerContext
I'm trying to create some automated offline tests of an application which makes use of a number of AWS services such as DynamoDB, S3, and SQS. The tests use libraries such as S3Mock and DynamoDBLocal to mimic the AWS APIs without needing to hit an actual AWS account.
The tests are breaking because S3Mock does not require authentication, so I used anonymous credentials when setting up the S3 client, but S3Mock uses akka-http under the hood which strictly enforces the host header for HTTP 1.1 requests.
this issue is reported in findify/s3mock#147 as well.
Your Environment
The text was updated successfully, but these errors were encountered: