[hunchentoot-devel] 'Host', ports and redirect.

Vladimir Sedach vsedach at gmail.com
Wed Sep 26 05:07:47 UTC 2007


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: server_hostname.patch
Type: application/octet-stream
Size: 2549 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/tbnl-devel/attachments/20070925/4132c8de/attachment.obj>


More information about the Tbnl-devel mailing list