hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HTTPCLIENT-1193) Regression causing issues with cross-site redirects
Date Fri, 25 May 2012 15:21:24 GMT

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved HTTPCLIENT-1193.
-------------------------------------------

       Resolution: Fixed
    Fix Version/s: 4.2.1

Fixed in SVN trunk. For the time being use SingleConnectionManager or PoolingConnectionManager
instead of the default one to work the problem around.

Oleg
                
> Regression causing issues with cross-site redirects
> ---------------------------------------------------
>
>                 Key: HTTPCLIENT-1193
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1193
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2 Final
>            Reporter: Magnus Gustavsson
>             Fix For: 4.2.1
>
>
> The release version of HttpClient 4.2 introduces a regression with cross-site redirects
that didn't exist previously.
> According to Oleg Kalnichevski in HTTPCLIENT-1185: "There is unfortunately a bug in the
BasicClientConnectionManager introduced in 4.2 causing issues with cross-site redirects."
> For example, the following code
> import java.io.IOException;
> import org.apache.http.client.HttpClient;
> import org.apache.http.client.methods.HttpGet;
> import org.apache.http.impl.client.DefaultHttpClient;
> public class BadRequest {
>     public static void main(String[] args) {
> 	try {
> 	    HttpClient httpclient = new DefaultHttpClient();
> 	    HttpGet httpget = new HttpGet("http://www.edu.mah.se/KK3231/syllabus/");
> 	    System.out.println(httpclient.execute(httpget).getStatusLine().getStatusCode());
> 	} catch (IOException e) {
> 	    e.printStackTrace();
> 	}
>     }
> }
> raises an exception as follows:
> % java BadRequest     
> org.apache.http.client.ClientProtocolException
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:909)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
> 	at BadRequest.main(BadRequest.java:13)
> Caused by: org.apache.http.HttpException: Unable to establish route: planned = {}->http://edu.mah.se;
current = {}->http://www.edu.mah.se
> 	at org.apache.http.impl.client.DefaultRequestDirector.establishRoute(DefaultRequestDirector.java:842)
> 	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:645)
> 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
> 	at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
> 	... 3 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message