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

fix filtering content-type and content-length headers in HttpClientBa… #2135

Merged

Conversation

ashashev
Copy link
Contributor

Before submitting pull request:

  • Check if the project compiles by running sbt compile
  • Verify docs compilation by running sbt compileDocs
  • Check if tests pass by running sbt test
  • Format code by running sbt scalafmt

Problems

The java HttpClient prohibits to add Content-Type header to request, it's reason HttpClientBacked filters this header. But the check is case-sensitive. So passing content-type (in lower case) header occurs IllegalArgumentException.

Another problem is duplicating content-type header inside request if the header name passed in lowercase.

These problems might happen if an application gets these headers from an incoming HTTP request and then pass them to a new HTTP request to another service.

@adamw adamw merged commit e97f73f into softwaremill:master Apr 14, 2024
12 checks passed
@adamw
Copy link
Member

adamw commented Apr 14, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants