1313 */
1414package org .asynchttpclient .netty .handler .intercept ;
1515
16+ import static io .netty .handler .codec .http .HttpHeaders .Names .*;
1617import static org .asynchttpclient .Dsl .realm ;
1718import static org .asynchttpclient .util .AuthenticatorUtils .*;
1819import static org .asynchttpclient .util .MiscUtils .withDefault ;
@@ -72,7 +73,7 @@ public boolean exitAfterHandling401(//
7273 return false ;
7374 }
7475
75- List <String > wwwAuthHeaders = response .headers ().getAll (HttpHeaders . Names . WWW_AUTHENTICATE );
76+ List <String > wwwAuthHeaders = response .headers ().getAll (WWW_AUTHENTICATE );
7677
7778 if (wwwAuthHeaders .isEmpty ()) {
7879 LOGGER .info ("Can't handle 401 as response doesn't contain WWW-Authenticate headers" );
@@ -193,15 +194,15 @@ private void ntlmChallenge(String authenticateHeader,//
193194 String challengeHeader = NtlmEngine .INSTANCE .generateType1Msg ();
194195 // FIXME we might want to filter current NTLM and add (leave other
195196 // Authorization headers untouched)
196- requestHeaders .set (HttpHeaders . Names . AUTHORIZATION , "NTLM " + challengeHeader );
197+ requestHeaders .set (AUTHORIZATION , "NTLM " + challengeHeader );
197198 future .getInAuth ().set (false );
198199
199200 } else {
200201 String serverChallenge = authenticateHeader .substring ("NTLM " .length ()).trim ();
201202 String challengeHeader = NtlmEngine .INSTANCE .generateType3Msg (realm .getPrincipal (), realm .getPassword (), realm .getNtlmDomain (), realm .getNtlmHost (), serverChallenge );
202203 // FIXME we might want to filter current NTLM and add (leave other
203204 // Authorization headers untouched)
204- requestHeaders .set (HttpHeaders . Names . AUTHORIZATION , "NTLM " + challengeHeader );
205+ requestHeaders .set (AUTHORIZATION , "NTLM " + challengeHeader );
205206 }
206207 }
207208
@@ -215,6 +216,6 @@ private void kerberosChallenge(Channel channel,//
215216 Uri uri = request .getUri ();
216217 String host = withDefault (request .getVirtualHost (), uri .getHost ());
217218 String challengeHeader = SpnegoEngine .instance ().generateToken (host );
218- headers .set (HttpHeaders . Names . AUTHORIZATION , NEGOTIATE + " " + challengeHeader );
219+ headers .set (AUTHORIZATION , NEGOTIATE + " " + challengeHeader );
219220 }
220221}
0 commit comments