Skip to content

Commit a4d487d

Browse files
author
Stephane Landelle
committed
1 parent 33caaf4 commit a4d487d

File tree

2 files changed

+5
-2
lines changed
  • api/src/main/java/org/asynchttpclient
  • providers/netty/src/main/java/org/asynchttpclient/providers/netty/handler

2 files changed

+5
-2
lines changed

api/src/main/java/org/asynchttpclient/Realm.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,10 @@ public RealmBuilder setUsePreemptiveAuth(boolean usePreemptiveAuth) {
400400
public RealmBuilder parseWWWAuthenticateHeader(String headerLine) {
401401
setRealmName(match(headerLine, "realm"));
402402
setNonce(match(headerLine, "nonce"));
403-
setAlgorithm(match(headerLine, "algorithm"));
403+
String algorithm = match(headerLine, "algorithm");
404+
if (isNonEmpty(algorithm)) {
405+
setAlgorithm(algorithm);
406+
}
404407
setOpaque(match(headerLine, "opaque"));
405408
setQop(match(headerLine, "qop"));
406409
if (isNonEmpty(getNonce())) {

providers/netty/src/main/java/org/asynchttpclient/providers/netty/handler/HttpProtocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ private boolean handleUnauthorizedAndExit(int statusCode, Realm realm, final Req
227227
.parseWWWAuthenticateHeader(authenticateHeaders.get(0)).build();
228228
}
229229

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

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

0 commit comments

Comments
 (0)