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

HTTP Host header not set with Netty/Native Java implementations #1467

Closed
sworisbreathing opened this issue Oct 10, 2019 · 1 comment
Closed
Labels
feature-request A feature should be added or improved.

Comments

@sworisbreathing
Copy link
Contributor

Originally reported in #429. Also reported at findify/s3mock#147. Per my investigation on that ticket, it appears to be a bug in the AWS SDK v2, not in s3mock.

Expected Behavior

All HTTP client implementations should implicitly set the Host header when communicating via HTTP 1.1 (this is a mandatory header)

Current Behavior

Only the Apache implementation sets this header

Possible Solution

  1. Implicitly set the host header in netty-nio-client and url-connection-client, and/or
  2. Implicitly set the host header in SdkHttpRequest

Steps to Reproduce (for bugs)

  1. Follow the instructions in the SDK documentation for setting up the Netty Client
  2. Enable request logging (or configure it to go through a logging proxy such as charles proxy)
  3. Observe the missing Host headers

Context

I have an app that was originally developed against the v1 SDK, which has automated integration tests that use https://github.com/findify/s3mock. After switching to the v2 sdk I observed the same issue reported in findify/s3mock#147. Stepping through the code in a debugger session I could see my app was using the Netty implementation. Digging through the code I was able to find that the Apache implementation sets the host header but Netty and UrlConnection do not.

Your Environment

  • AWS Java SDK version used: 2.9.15 (however the issue still exists in 2.9.17)
  • JDK version used: OpenJDK 12
  • Operating System and version: Windows 10
@dagnir
Copy link
Contributor

dagnir commented Nov 11, 2019

Closed by #1500.

@dagnir dagnir closed this as completed Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants