Skip to content

Commit 96318b3

Browse files
author
Stephane Landelle
committed
Fix previous commit
1 parent 6fc77ab commit 96318b3

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/statushandler/AuthorizationHandler.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.glassfish.grizzly.http.util.Header;
2727
import org.glassfish.grizzly.http.util.HttpStatus;
2828

29-
import java.security.NoSuchAlgorithmException;
3029
import java.util.Locale;
3130

3231
public final class AuthorizationHandler implements StatusHandler {
@@ -75,11 +74,7 @@ public boolean handleStatus(final HttpResponsePacket responsePacket, final HttpT
7574
req.getHeaders().add(Header.Authorization.toString(), AuthenticatorUtils.computeBasicAuthentication(realm));
7675
} else if (lowerCaseAuth.startsWith("digest")) {
7776
req.getHeaders().remove(Header.Authorization.toString());
78-
try {
79-
req.getHeaders().add(Header.Authorization.toString(), AuthenticatorUtils.computeDigestAuthentication(realm));
80-
} catch (NoSuchAlgorithmException e) {
81-
throw new IllegalStateException("Digest authentication not supported", e);
82-
}
77+
req.getHeaders().add(Header.Authorization.toString(), AuthenticatorUtils.computeDigestAuthentication(realm));
8378
} else {
8479
throw new IllegalStateException("Unsupported authorization method: " + auth);
8580
}

providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/statushandler/ProxyAuthorizationHandler.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.ietf.jgss.Oid;
3535
import org.slf4j.LoggerFactory;
3636

37-
import java.security.NoSuchAlgorithmException;
3837
import java.util.Locale;
3938

4039
public final class ProxyAuthorizationHandler implements StatusHandler {
@@ -70,11 +69,7 @@ public boolean handleStatus(final HttpResponsePacket responsePacket, final HttpT
7069
} else if (proxyAuthLowerCase.startsWith("digest")) {
7170
req.getHeaders().remove(Header.ProxyAuthenticate.toString());
7271
req.getHeaders().remove(Header.ProxyAuthorization.toString());
73-
try {
74-
req.getHeaders().add(Header.ProxyAuthorization.toString(), AuthenticatorUtils.computeDigestAuthentication(realm));
75-
} catch (NoSuchAlgorithmException e) {
76-
throw new IllegalStateException("Digest authentication not supported", e);
77-
}
72+
req.getHeaders().add(Header.ProxyAuthorization.toString(), AuthenticatorUtils.computeDigestAuthentication(realm));
7873
} else if (proxyAuthLowerCase.startsWith("ntlm")) {
7974

8075
req.getHeaders().remove(Header.ProxyAuthenticate.toString());

providers/netty/src/main/java/org/asynchttpclient/providers/netty/request/NettyRequestFactory.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
import java.io.IOException;
3737
import java.nio.charset.Charset;
38-
import java.security.NoSuchAlgorithmException;
3938
import java.util.List;
4039
import java.util.Map.Entry;
4140

@@ -104,13 +103,8 @@ private String authorizationHeader(Request request, Uri uri, ProxyServer proxySe
104103
authorizationHeader = computeBasicAuthentication(realm);
105104
break;
106105
case DIGEST:
107-
if (isNonEmpty(realm.getNonce())) {
108-
try {
109-
authorizationHeader = computeDigestAuthentication(realm);
110-
} catch (NoSuchAlgorithmException e) {
111-
throw new SecurityException(e);
112-
}
113-
}
106+
if (isNonEmpty(realm.getNonce()))
107+
authorizationHeader = computeDigestAuthentication(realm);
114108
break;
115109
case NTLM:
116110
String domain;

0 commit comments

Comments
 (0)