Created
August 18, 2015 18:30
-
-
Save jcodagnone/1f3f736c672e3a3f8317 to your computer and use it in GitHub Desktop.
Jersey Client: Basic Authentication schema is case insensitive (rfc 2617 section 1.2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core-client/src/main/java/org/glassfish/jersey/client/authentication/BasicAuthenticator.java b/core-client/src/main/java/org/glassfish/jersey/client/authentication/BasicAuthenticator.java | |
index 981abfa..0e692e7 100644 | |
--- a/core-client/src/main/java/org/glassfish/jersey/client/authentication/BasicAuthenticator.java | |
+++ b/core-client/src/main/java/org/glassfish/jersey/client/authentication/BasicAuthenticator.java | |
@@ -115,7 +115,7 @@ final class BasicAuthenticator { | |
*/ | |
public boolean filterResponseAndAuthenticate(ClientRequestContext request, ClientResponseContext response) { | |
final String authenticate = response.getHeaders().getFirst(HttpHeaders.WWW_AUTHENTICATE); | |
- if (authenticate != null && authenticate.trim().startsWith("Basic")) { | |
+ if (authenticate != null && authenticate.trim().toUpperCase().startsWith("BASIC")) { | |
HttpAuthenticationFilter.Credentials credentials = HttpAuthenticationFilter | |
.getCredentials(request, defaultCredentials, HttpAuthenticationFilter.Type.BASIC); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment