ning / async-http-client

Asynchronous Http Client for Java
135 stars 50 forks source link

Query string with colon results in exception #30

Closed alaz closed 14 years ago

alaz commented 14 years ago

Test case is here: http://github.com/alaz/async-http-client/commit/372776cfa49c0365dd1d5483b9a65f6ed56c0bc0

The exception looks like

java.lang.StringIndexOutOfBoundsException: String index out of range: 56
at java.lang.String.substring(String.java:1934)
at com.ning.http.client.providers.NettyAsyncHttpProvider.getBaseUrl(NettyAsyncHttpProvider.java:668)
at com.ning.http.client.providers.NettyAsyncHttpProvider.lookupInCache(NettyAsyncHttpProvider.java:160)
at com.ning.http.client.providers.NettyAsyncHttpProvider.doConnect(NettyAsyncHttpProvider.java:474)
at com.ning.http.client.providers.NettyAsyncHttpProvider.execute(NettyAsyncHttpProvider.java:451)
at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:401)
at com.ning.http.client.AsyncHttpClient$BoundRequestBuilder.execute(AsyncHttpClient.java:202)
at com.ning.http.client.async.ComplexClientTest.urlWithColonTest(ComplexClientTest.java:143)
neotyk commented 14 years ago

Good catch and awesome bug report. Thanks a million.

Fix available in http://github.com/neotyk/async-http-client/commits/issue-30 do pull.

alaz commented 14 years ago

Thanks!

neotyk commented 14 years ago

You are welcome, this kind of bug reports make me enjoy fixing them :)

jfarcand commented 14 years ago

Applied THANKS! http://github.com/ning/async-http-client/commit/32d757b765858fd69343d51d060fe0066e4f4650