Skip to content

Commit 204df54

Browse files
jloomisjfarcand
authored andcommitted
Allow urls with missing query param values
allow urls such as http://youtu.be/26dBZ7DPglE?a (pattern used by a lot of url shorteners)
1 parent 9355a94 commit 204df54

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/ning/http/client/RequestBuilderBase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,10 @@ private String buildUrl(String url) {
275275
for( String query : queries) {
276276
pos = query.indexOf("=");
277277
if (pos <= 0) {
278-
throw new IllegalStateException("Illegal URL: " + url);
278+
addQueryParameter(query, null);
279+
}else{
280+
addQueryParameter(query.substring(0, pos) , query.substring(pos +1));
279281
}
280-
addQueryParameter(query.substring(0, pos) , query.substring(pos +1));
281282
}
282283
}
283284
return buildedUrl.toString();

0 commit comments

Comments
 (0)