If the HTTP client wants to request protocol upgrade, it must
send the Upgrade header. It should also set the Connection
header. This test didn't do that, so conforming implementations
could reject the request.upgrade() call. The fix is simple:
add the 2 headers on the client side (i.e., in the test).
To be able to set Connection and Upgrade headers on the
java.net.HttpURLConnection, restricted headers must be allowed
by setting a special system property.
If the HTTP client wants to request protocol upgrade, it must send the
Upgrade
header. It should also set theConnection
header. This test didn't do that, so conforming implementations could reject therequest.upgrade()
call. The fix is simple: add the 2 headers on the client side (i.e., in the test).To be able to set
Connection
andUpgrade
headers on thejava.net.HttpURLConnection
, restricted headers must be allowed by setting a special system property.See also https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism and the Servlet specification 4.0, section 2.3.3.5.