diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-01 15:30:33 (JST) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-09-02 08:26:37 (JST) |
commit | 9c931b1e6e68f8dc891a5653035c3d70038ae3c0 (patch) | |
tree | a5cd6d953eb66ad77eb4e5b088e2022973fc4f61 /ui-snapshot.c | |
parent | 687fb6d833d25144c86d1841fe0eca611f1eaeb1 (diff) | |
download | cgit-9c931b1e6e68f8dc891a5653035c3d70038ae3c0.zip cgit-9c931b1e6e68f8dc891a5653035c3d70038ae3c0.tar.gz |
use Host: header to generate cgit_hosturl
I run an instance of lighttpd for cgit behind nginx (nginx
doesn't execute CGI). So the port (SERVER_PORT=33333) that
lighttpd runs on sends to cgit is different from the standard
port 80 that public clients connect to (via nginx).
This was causing the Atom feed URL to show the private port
number that lighttpd was running on.
Since the HTTP/1.1 "Host" header includes the port number if
running on a non-standard port, it allows non-client-facing HTTP
servers to transparently generate public URLs that clients can
see.
So use the "Host" header if it is available and fall back to
SERVER_NAME/SERVER_PORT for some clients that don't set
HTTP_HOST.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'ui-snapshot.c')
0 files changed, 0 insertions, 0 deletions