Skip to content

Commit fda1596

Browse files
committed
Incremental fix for AsyncHttpClient#63. Ensure Grizzly provider doesn't cause a timeout when dealing with an authorization response with no provided realm.
1 parent 9d922ad commit fda1596

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/ning/http/client/providers/grizzly/GrizzlyAsyncHttpProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,6 @@ public boolean handleStatus(final HttpResponsePacket responsePacket,
14321432
final HttpTransactionContext httpTransactionContext,
14331433
final FilterChainContext ctx) {
14341434

1435-
responsePacket.setSkipRemainder(true); // ignore the remainder of the response
14361435
final String auth = responsePacket.getHeader(Header.WWWAuthenticate);
14371436
if (auth == null) {
14381437
throw new IllegalStateException("401 response received, but no WWW-Authenticate header was present");
@@ -1446,6 +1445,9 @@ public boolean handleStatus(final HttpResponsePacket responsePacket,
14461445
httpTransactionContext.invocationStatus = InvocationStatus.STOP;
14471446
return true;
14481447
}
1448+
1449+
responsePacket.setSkipRemainder(true); // ignore the remainder of the response
1450+
14491451
final Request req = httpTransactionContext.request;
14501452
realm = new Realm.RealmBuilder().clone(realm)
14511453
.setScheme(realm.getAuthScheme())

0 commit comments

Comments
 (0)