Skip to content

Commit 4e6e58f

Browse files
committed
throw illegalArg error on null location
some url shorteners sometimes return 302s without a location header (bah.) throw illegal arg exception rather than NPE from URI.resolve
1 parent 3f38a22 commit 4e6e58f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/ning/http/util/AsyncHttpProviderUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ public final static String getHost(URI uri) {
218218
}
219219

220220
public final static URI getRedirectUri(URI uri, String location) {
221+
if(location == null)
222+
throw new IllegalArgumentException("URI " + uri + " was redirected to null location");
221223
URI newUri = uri.resolve(location);
222224

223225
String scheme = newUri.getScheme();

0 commit comments

Comments
 (0)