update restricted headers in jdk11 client implementation #2366
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates the list of restricted headers in jdk11 client implementation.
The current implementation still contains the original disallowed headers from ~6 years ago. Since then there were a few updates making the header restriction less strict. By default only
connection content-length expect host upgrade
headers are now restricted:https://github.com/openjdk/jdk/blob/20cb6e786fbf6d924c509e28d6fded86d61a5f84/src/java.net.http/share/classes/jdk/internal/net/http/common/Utils.java#L178-L179
There is a test in the JDK showing that these headers are now available:
https://github.com/openjdk/jdk/blob/20cb6e786fbf6d924c509e28d6fded86d61a5f84/test/jdk/java/net/httpclient/RequestBuilderTest.java#L345-L358
However, users can allow them anyway setting the
jdk.httpclient.allowRestrictedHeaders
property in their net.properties, but I did not include that case into this PR.