Skip to content

Commit 67f1cd6

Browse files
committed
Over HTTPS, per request proxy auth header should only be sent on CONNECT, close #1153
1 parent faa6fca commit 67f1cd6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/src/main/java/org/asynchttpclient/netty/request/NettyRequestFactory.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ public NettyRequest newNettyRequest(Request request, boolean forceConnect, Proxy
199199

200200
// don't override authorization but append
201201
addAuthorizationHeader(headers, perRequestAuthorizationHeader(realm));
202-
setProxyAuthorizationHeader(headers, perRequestProxyAuthorizationHeader(proxyRealm));
202+
// only set proxy auth on request over plain HTTP, or when performing CONNECT
203+
if (!uri.isSecured() || connect) {
204+
setProxyAuthorizationHeader(headers, perRequestProxyAuthorizationHeader(proxyRealm));
205+
}
203206

204207
// Add default accept headers
205208
if (!headers.contains(ACCEPT))

0 commit comments

Comments
 (0)