Skip to content

Commit 6eccf6a

Browse files
author
Miro Bezjak
committed
Authentication header includes `NTLM' auth-scheme.
Example HTTP header: Authentication: NTLM ntlm-stuff-here\r\n This is the way Firefox and Chromium work.
1 parent 8bde24e commit 6eccf6a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

providers/netty/src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public class NettyAsyncHttpProvider extends SimpleChannelUpstreamHandler impleme
146146

147147
private final static Logger log = LoggerFactory.getLogger(NettyAsyncHttpProvider.class);
148148
private final static Charset UTF8 = Charset.forName("UTF-8");
149-
149+
150150
private final ClientBootstrap plainBootstrap;
151151
private final ClientBootstrap secureBootstrap;
152152
private final ClientBootstrap webSocketBootstrap;
@@ -654,8 +654,8 @@ private static HttpRequest construct(AsyncHttpClientConfig config,
654654
break;
655655
case NTLM:
656656
try {
657-
nettyRequest.setHeader(HttpHeaders.Names.AUTHORIZATION,
658-
ntlmEngine.generateType1Msg("NTLM " + domain, authHost));
657+
String msg = ntlmEngine.generateType1Msg("NTLM " + domain, authHost);
658+
nettyRequest.setHeader(HttpHeaders.Names.AUTHORIZATION, "NTLM " + msg);
659659
} catch (NTLMEngineException e) {
660660
IOException ie = new IOException();
661661
ie.initCause(e);
@@ -2472,4 +2472,3 @@ private static boolean isSecure(URI uri) {
24722472
return isSecure(uri.getScheme());
24732473
}
24742474
}
2475-

0 commit comments

Comments
 (0)