Hello,
Currently, 'redirect' works by using 'host', which grabs the "Host" http header value. This works ok if the server is running on port 80, however if it is running on another port the value of "Host" is both the hostname and port, so for example (redirect "/foobar" :port 4243) would redirect to http://localhost:4242:4243/foobar if the first request came in to localhost:4242. The attached patch implements a new function on request objects, server-hostname, which returns just the hostname portion of the "Host" header value, and makes redirect use that.
Vladimir
On Tue, 25 Sep 2007 23:07:47 -0600, "Vladimir Sedach" vsedach@gmail.com wrote:
The attached patch implements a new function on request objects, server-hostname, which returns just the hostname portion of the "Host" header value, and makes redirect use that.
Thanks for the patch. I understand that it makes sense to strip off the port part of the "Host" header value, but I also like the current behaviour of REDIRECT where you get the default hostname and port for free. I've now uploaded a version which I hope combines both variants in an acceptable way. Please try.
Cheers, Edi.
Ok, this is good. My mistake for not thinking about the default behavior of redirect.
Vladimir
On 9/26/07, Edi Weitz edi@agharta.de wrote:
On Tue, 25 Sep 2007 23:07:47 -0600, "Vladimir Sedach" vsedach@gmail.com wrote:
The attached patch implements a new function on request objects, server-hostname, which returns just the hostname portion of the "Host" header value, and makes redirect use that.
Thanks for the patch. I understand that it makes sense to strip off the port part of the "Host" header value, but I also like the current behaviour of REDIRECT where you get the default hostname and port for free. I've now uploaded a version which I hope combines both variants in an acceptable way. Please try.
Cheers, Edi. _______________________________________________ tbnl-devel site list tbnl-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/tbnl-devel