summaryrefslogtreecommitdiffabout
path: root/ui-shared.h
authorEric Wong <normalperson@yhbt.net>2008-09-01 06:30:33 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-09-01 23:26:37 (UTC)
commit9c931b1e6e68f8dc891a5653035c3d70038ae3c0 (patch) (unidiff)
treea5cd6d953eb66ad77eb4e5b088e2022973fc4f61 /ui-shared.h
parent687fb6d833d25144c86d1841fe0eca611f1eaeb1 (diff)
downloadcgit-9c931b1e6e68f8dc891a5653035c3d70038ae3c0.zip
cgit-9c931b1e6e68f8dc891a5653035c3d70038ae3c0.tar.gz
cgit-9c931b1e6e68f8dc891a5653035c3d70038ae3c0.tar.bz2
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-shared.h') (more/less context) (show whitespace changes)
0 files changed, 0 insertions, 0 deletions