hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <adrian.sut...@ephox.com>
Subject RE: Redirect to a different domain not supported?
Date Mon, 24 Feb 2003 04:13:08 GMT
This is a remnant from the old design of HttpClient and hopefully will be
removed soon.  I'm not sure of the technical details involved, but there is
definitely nothing in the RFC that goes against this and it is a commonly
requested feature.

If you felt like providing a patch I'm sure it would be greatly appreciated.
It's probably worth searching bugzilla (http://nagoya.apache.org/bugzilla)
for the bug related to this and seeing if it's assigned to anyone, I can't
remember if someone was working on it or not.


Adrian Sutton, Software Engineer
Ephox Corporation

-----Original Message-----
From: Jesus M. Salvo Jr. [mailto:jesus.salvo@migasia.com]
Sent: Monday, 24 February 2003 2:11 PM
To: commons-httpclient-dev@jakarta.apache.org
Subject: Redirect to a different domain not supported?

Using Alpha2, when I do an HTTP GET from an Australian ISP to 
www.google.com with setFollowRedirects set to true,

    HttpClient client = new HttpClient();
    HostConfiguration config = new HostConfiguration();
    config.setHost( "www.google.com", 80, "http" );
    client.setHostConfiguration( config );

    Method method = new GetMethod( "/" );
    method.setFollowRedirects( true );
    int returnCode = client.executeMethod( method );

I get:

750 [main] WARN httpclient.HttpMethod  - Redirect from host 
www.google.com to www.google.com.au is not supported

I had a look at the code and it was comparing the hostname of the 
original URL and the hostname of the redirect to URL ... and if they do 
not match, it does not follow the redirect.

Why is this so? Is this specifically prohibited in the HTTP RFC? If yes, 
why does browsers follow them anyway?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message