[twsocket] HTTP relocation
= Connected to: www.cytauk.com GET / HTTP/1.0 Host: www.cytauk.com HTTP/1.1 302 Moved Temporarily Location: ./cytauk2/ = Connected to: www.cytauk.com GET /./cytauk2/ HTTP/1.0 Host: www.cytauk.com HTTP/1.1 404 Not Found Firefox seems to redirect to www.cytauk.com/cytauk2/ ignoring the extra ./ in the relocation header. Is the server wrong, Firefox too forgiving, or do we need a fix? Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] HTTP relocation
RFC says that Location can contain only absolute URI. Wikipedia say, that some software allows for relative URIs, but in that case they must start from leading slash. So the response of the given server seems incorrect. So http client may handle such malform relocations using its arbitrary custom implementation. Best wishes, Stan - Original Message - From: Angus Robertson - Magenta Systems Ltd an...@magsys.co.uk To: twsocket@elists.org Sent: Friday, November 30, 2012 7:13 PM Subject: [twsocket] HTTP relocation = Connected to: www.cytauk.com GET / HTTP/1.0 Host: www.cytauk.com HTTP/1.1 302 Moved Temporarily Location: ./cytauk2/ = Connected to: www.cytauk.com GET /./cytauk2/ HTTP/1.0 Host: www.cytauk.com HTTP/1.1 404 Not Found Firefox seems to redirect to www.cytauk.com/cytauk2/ ignoring the extra ./ in the relocation header. Is the server wrong, Firefox too forgiving, or do we need a fix? Angus -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Http relocation problem
Arno Garrels wrote: Steve Endicott wrote: I think I've found a problem with how HttpProt handles relocation. Thanks! It's at least registered, Reproduced and just checked in (V6 and V7). -- Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Http relocation problem
Steve Endicott wrote: I think I've found a problem with how HttpProt handles relocation. Thanks! It's at least registered, will try to look at it closer when I have some minutes left if nobody of the HTTP-specialists (i.e. Francois) were faster. -- Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Http relocation problem
I think I've found a problem with how HttpProt handles relocation. First, I have to give some background. I'm using Turbo Delphi 2006 and using an older version of ICS (HttpProt.pas ver 1.94 last updated 12/10/06). I haven't kept up with the latest revisions or followed them too closely so I didn't know if this problem had been corrected in a later version. To try to find out, I downloaded some later versions from the Overbyte web site. I checked: OverbyteIcsV5.zip (HttpProt.pas ver 1.94 last updated: 7/13/08) and OverbyteIcsV6_RC1.zip (OverbyteIcsHttpProt.pas ver 6.00.5 last updated: 6/25/08) and OverbyteIcsV7_Alpha1.zip (OverbyteIcsHttpProt.pas ver 6.00.6 last updated: 7/17/08). I found the same problem in each of these versions so I think I need to bring it to people's attention. The problem is in: THttpCli.GetHeaderLineNext where it's handling a non-proxy relocation to an absolute location (near line 2800 in the source). The code is: { We are not using a proxy } else begin if Data[1] = '/' then begin { Absolute location } FPath := Data; if Proto = '' then Proto := 'http'; FLocation := Proto + '://' + FHostName + FPath; end The problem is that Proto has never been set at this time. When the check (if Proto = '' then) is made, the relocation will switch us from https to http. I modified the code to the following: { We are not using a proxy } else begin ParseURL(FURL, proto, user, pass, Host, port, Path); if Data[1] = '/' then begin { Absolute location } FPath := Data; if Proto = '' then Proto := 'http'; FLocation := Proto + '://' + FHostName + FPath; end This corrected the problem for me. It should also correct the same problem for Relative location in the next block of code. Since I'm not working with the latest versions, I thought I'd pass this along so that someone who is working with the current version could correct it. Thanks. Steve -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be