Re: Redirect to a different domain not supported?
No. Its still preliminary. Jesus M. Salvo Jr. wrote: Did Oleg's work on the redirect made it to alpha3 rc4? Oleg Kalnichevski wrote: Folks I was going to start working on it today. If there are any other takers, please let me know Cheers Oleg On Mon, 2003-02-24 at 07:27, Jeffrey Dever wrote: This is currently on the todo list. Refer to the following bug for more information: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16729 Adrian Sutton wrote: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect to a different domain not supported?
Did Oleg's work on the redirect made it to alpha3 rc4? Oleg Kalnichevski wrote: Folks I was going to start working on it today. If there are any other takers, please let me know Cheers Oleg On Mon, 2003-02-24 at 07:27, Jeffrey Dever wrote: This is currently on the todo list. Refer to the following bug for more information: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16729 Adrian Sutton wrote: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect to a different domain not supported?
Folks I was going to start working on it today. If there are any other takers, please let me know Cheers Oleg On Mon, 2003-02-24 at 07:27, Jeffrey Dever wrote: > This is currently on the todo list. Refer to the following bug for more > information: > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16729 > > > Adrian Sutton wrote: > > >>So I am wondering ... in the case of a different host and port ( and > >>protocol? ), why not also call setHostConfiguration() ... and possible > >>also change the HttpConnection that is passed in so that the host and > >>port are changed? > >> > >> > > > >Because when that comment was written, the method didn't know which host it > >was connecting to, it only held a relative path. That shouldn't be a > >problem anymore. I'm not sure how HttpConnections are retrieved these days, > >but it shouldn't be too difficult to sort out. > > > >Thanks for looking into this. > > > >Adrian Sutton, Software Engineer > >Ephox Corporation > >www.ephox.com > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect to a different domain not supported?
This is currently on the todo list. Refer to the following bug for more information: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16729 Adrian Sutton wrote: So I am wondering ... in the case of a different host and port ( and protocol? ), why not also call setHostConfiguration() ... and possible also change the HttpConnection that is passed in so that the host and port are changed? Because when that comment was written, the method didn't know which host it was connecting to, it only held a relative path. That shouldn't be a problem anymore. I'm not sure how HttpConnections are retrieved these days, but it shouldn't be too difficult to sort out. Thanks for looking into this. Adrian Sutton, Software Engineer Ephox Corporation www.ephox.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Redirect to a different domain not supported?
>So I am wondering ... in the case of a different host and port ( and >protocol? ), why not also call setHostConfiguration() ... and possible >also change the HttpConnection that is passed in so that the host and >port are changed? Because when that comment was written, the method didn't know which host it was connecting to, it only held a relative path. That shouldn't be a problem anymore. I'm not sure how HttpConnections are retrieved these days, but it shouldn't be too difficult to sort out. Thanks for looking into this. Adrian Sutton, Software Engineer Ephox Corporation www.ephox.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect to a different domain not supported?
I initally thought that commenting out the specific code in checkValidRedirect() would do it, but the Javadoc for HttpMethodBase.execute() did say: * Execute this method. Note that we cannot currently support redirects * that change the connection parameters (host, port, protocol) because * we don't yet have a good way to get the new connection. For the time * being, we just return the redirect response code, and allow the user * agent to resubmit if desired. If the host and protocol and ports are the same, it simply calls HttpMethodBase.setPath() and HttpMethodBase.setQueryString(): //check for redirect to a different protocol, host or port try { checkValidRedirect(currentUrl, redirectUrl); } catch (HttpException ex) { //LOG the error and let the client handle the redirect LOG.warn(ex.getMessage()); return false; } //update the current location with the redirect location. //avoiding use of URL.getPath() and URL.getQuery() to keep //jdk1.2 comliance. setPath(URIUtil.getPath(redirectUrl.toString())); setQueryString(URIUtil.getQuery(redirectUrl.toString())); So I am wondering ... in the case of a different host and port ( and protocol? ), why not also call setHostConfiguration() ... and possible also change the HttpConnection that is passed in so that the host and port are changed? Adrian Sutton wrote: 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. Regards, Adrian Sutton, Software Engineer Ephox Corporation www.ephox.com -Original Message- From: Jesus M. Salvo Jr. [mailto:[EMAIL PROTECTED] Sent: Monday, 24 February 2003 2:11 PM To: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesus M. Salvo Jr. Mobile Internet Group Pty Ltd (formerly Softgame International Pty Ltd) M: +61 409 126699 T: +61 2 94604777 F: +61 2 94603677 PGP Public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC0BA5348 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Redirect to a different domain not supported?
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. Regards, Adrian Sutton, Software Engineer Ephox Corporation www.ephox.com -Original Message- From: Jesus M. Salvo Jr. [mailto:[EMAIL PROTECTED] Sent: Monday, 24 February 2003 2:11 PM To: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]