[Xitami] Xitami bug with relative redirects

Francis Turner xitami@lists.xitami.org
Wed, 20 Feb 2002 12:27:54 +0100


Using the standard CGI.pm you can (theoretically) redirect people to a 
URl doing something like
print $query->redirect("destination.url"). This prints two lines to STDOUT

Status: 302 Moved
location: destination.url

And normally you get a redirect from there.

It works is my destination.url is a fully defined 
http://host/path/file.html or similar

But I have found 2 bugs in this with Xitami when one uses a non absolute URL

with a file only relative url (just file.html) it chops of the leading 
character to produce a redirect to ile.html in the ROOT of the webserver 
. i.e. the absolute URL is http://host/ile.html
with a path and file relative url (/path/file.html) the redirect never 
completes and xitami just sits there serving up nothing until you hit 
cancel - conceivably there is a timeout after 120 seconds or whatever 
but I didn't wait that long.

This does not appear to occur with Apache which handles both relative 
URLs just fine. Arguably this is a bug with the redirect generator as  
RFC 2616 (http 1.1) section 14.30 states that only absolute URIs are 
allowed for the location field, but it would be nice to see it 
documented if not fixed.

14.30 Location

   The Location response-header field is used to redirect the recipient
   to a location other than the Request-URI for completion of the
   request or identification of a new resource. For 201 (Created)
   responses, the Location is that of the new resource which was created
   by the request. For 3xx responses, the location SHOULD indicate the
   server's preferred URI for automatic redirection to the resource. The
   field value consists of a single absolute URI.


Francis

-- 
...if the US Government were ever to get really serious about Internet 
security, the top players in Microsoft's management hierarchy would find 
themselves handcuffed, blindfolded, led onto a tarmac within some obscure 
Air Force base, and shot.
-- Thomas C Greene (http://www.theregister.co.uk/content/55/23223.html)