[11u] RFR: JDK-8222527: HttpClient doesn't send HOST header when tunelling HTTP/1.1 through http proxy

Andrew Hughes gnu.andrew at redhat.com
Thu Nov 26 18:10:56 UTC 2020


Bug: https://bugs.openjdk.java.net/browse/JDK-8222527
Webrev: https://cr.openjdk.java.net/~andrew/openjdk11/8222527/webrev.01/

When connecting to a proxy, OpenJDK filters out all but the Proxy-*
HTTP headers. This violates the HTTP specification which states that
the Host header should always be sent.

This patch includes the Host header in the proxy filter exemptions.
This backport is simpler than the original included in 13u, as 11u
does not include JDK-8213189, which allows the user to customise
headers. As such, we only need to alter the proxy filter and not
worry about the set of restricted headers being altered by the
jdk.httpclient.allowRestrictedHeaders property.

The included test fails on current 11u and passes with this patch.

Thanks,
--
Andrew :)

Senior Free Java Software Engineer
OpenJDK Package Owner
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222


More information about the jdk-updates-dev mailing list