Changed regex for AUTHENTICATE_PATTERN so that the realm doesn't need to appear as first parameter. #1555

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2018-04-10 14:47:00 +10:00
parent e5b84856d2
commit bc4ad7c61a
1 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ public abstract class AuthenticationProtocolHandler implements ProtocolHandler
{
public static final int DEFAULT_MAX_CONTENT_LENGTH = 16*1024;
public static final Logger LOG = Log.getLogger(AuthenticationProtocolHandler.class);
private static final Pattern AUTHENTICATE_PATTERN = Pattern.compile("([^\\s]+)\\s+realm=\"([^\"]*)\"(.*)", Pattern.CASE_INSENSITIVE);
private static final Pattern AUTHENTICATE_PATTERN = Pattern.compile("([^\\s]+)\\s(.*)realm=\"([^\"]*)\"(.*)", Pattern.CASE_INSENSITIVE);
private final HttpClient client;
private final int maxContentLength;
@ -241,8 +241,8 @@ public abstract class AuthenticationProtocolHandler implements ProtocolHandler
if (matcher.matches())
{
String type = matcher.group(1);
String realm = matcher.group(2);
String params = matcher.group(3);
String realm = matcher.group(3);
String params = matcher.group(2) + matcher.group(4);
Authentication.HeaderInfo headerInfo = new Authentication.HeaderInfo(type, realm, params, getAuthorizationHeader());
result.add(headerInfo);
}