13
13
*/
14
14
package org .asynchttpclient .netty .handler .intercept ;
15
15
16
+ import static io .netty .handler .codec .http .HttpHeaders .Names .*;
16
17
import static org .asynchttpclient .Dsl .realm ;
17
18
import static org .asynchttpclient .util .AuthenticatorUtils .*;
18
19
import static org .asynchttpclient .util .MiscUtils .withDefault ;
@@ -72,7 +73,7 @@ public boolean exitAfterHandling401(//
72
73
return false ;
73
74
}
74
75
75
- List <String > wwwAuthHeaders = response .headers ().getAll (HttpHeaders . Names . WWW_AUTHENTICATE );
76
+ List <String > wwwAuthHeaders = response .headers ().getAll (WWW_AUTHENTICATE );
76
77
77
78
if (wwwAuthHeaders .isEmpty ()) {
78
79
LOGGER .info ("Can't handle 401 as response doesn't contain WWW-Authenticate headers" );
@@ -193,15 +194,15 @@ private void ntlmChallenge(String authenticateHeader,//
193
194
String challengeHeader = NtlmEngine .INSTANCE .generateType1Msg ();
194
195
// FIXME we might want to filter current NTLM and add (leave other
195
196
// Authorization headers untouched)
196
- requestHeaders .set (HttpHeaders . Names . AUTHORIZATION , "NTLM " + challengeHeader );
197
+ requestHeaders .set (AUTHORIZATION , "NTLM " + challengeHeader );
197
198
future .getInAuth ().set (false );
198
199
199
200
} else {
200
201
String serverChallenge = authenticateHeader .substring ("NTLM " .length ()).trim ();
201
202
String challengeHeader = NtlmEngine .INSTANCE .generateType3Msg (realm .getPrincipal (), realm .getPassword (), realm .getNtlmDomain (), realm .getNtlmHost (), serverChallenge );
202
203
// FIXME we might want to filter current NTLM and add (leave other
203
204
// Authorization headers untouched)
204
- requestHeaders .set (HttpHeaders . Names . AUTHORIZATION , "NTLM " + challengeHeader );
205
+ requestHeaders .set (AUTHORIZATION , "NTLM " + challengeHeader );
205
206
}
206
207
}
207
208
@@ -215,6 +216,6 @@ private void kerberosChallenge(Channel channel,//
215
216
Uri uri = request .getUri ();
216
217
String host = withDefault (request .getVirtualHost (), uri .getHost ());
217
218
String challengeHeader = SpnegoEngine .instance ().generateToken (host );
218
- headers .set (HttpHeaders . Names . AUTHORIZATION , NEGOTIATE + " " + challengeHeader );
219
+ headers .set (AUTHORIZATION , NEGOTIATE + " " + challengeHeader );
219
220
}
220
221
}
0 commit comments