Skip to content

Commit

Permalink
Port #530 on master, close #529
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Landelle committed Apr 9, 2014
1 parent 33caaf4 commit a4d487d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion api/src/main/java/org/asynchttpclient/Realm.java
Expand Up @@ -400,7 +400,10 @@ public RealmBuilder setUsePreemptiveAuth(boolean usePreemptiveAuth) {
public RealmBuilder parseWWWAuthenticateHeader(String headerLine) {
setRealmName(match(headerLine, "realm"));
setNonce(match(headerLine, "nonce"));
setAlgorithm(match(headerLine, "algorithm"));
String algorithm = match(headerLine, "algorithm");
if (isNonEmpty(algorithm)) {
setAlgorithm(algorithm);
}
setOpaque(match(headerLine, "opaque"));
setQop(match(headerLine, "qop"));
if (isNonEmpty(getNonce())) {
Expand Down
Expand Up @@ -227,7 +227,7 @@ private boolean handleUnauthorizedAndExit(int statusCode, Realm realm, final Req
.parseWWWAuthenticateHeader(authenticateHeaders.get(0)).build();
}

Realm nr = new Realm.RealmBuilder().clone(newRealm).setUri(URI.create(request.getUrl()).getPath()).build();
Realm nr = new Realm.RealmBuilder().clone(newRealm).setUri(request.getURI().getPath()).build();
final Request nextRequest = new RequestBuilder(future.getRequest()).setHeaders(request.getHeaders()).setRealm(nr).build();

LOGGER.debug("Sending authentication to {}", request.getUrl());
Expand Down

0 comments on commit a4d487d

Please sign in to comment.