8270290: NTLM authentication fails if HEAD request is used

Reviewed-by: dfuchs, michaelm
This commit is contained in:
Alex Kasko 2021-09-30 15:21:18 +00:00 committed by Severin Gehwolf
parent bfd6163471
commit 3e0d7c33d4
2 changed files with 307 additions and 1 deletions

View file

@ -2961,7 +2961,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
/* must save before calling close */
reuseClient = http;
InputStream is = http.getInputStream();
if (!method.equals("HEAD")) {
if (!method.equals("HEAD") || tunnelState == TunnelState.SETUP) {
try {
/* we want to read the rest of the response without using the
* hurry mechanism, because that would close the connection