summaryrefslogtreecommitdiffabout
path: root/ui-shared.c
Side-by-side diff
Diffstat (limited to 'ui-shared.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-shared.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 4818e70..c23bc75 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -39,4 +39,8 @@ char *cgit_hosturl()
char *host, *port;
+ host = getenv("HTTP_HOST");
+ if (host) {
+ host = xstrdup(host);
+ } else {
host = getenv("SERVER_NAME");
if (!host)
@@ -47,4 +51,5 @@ char *cgit_hosturl()
else
host = xstrdup(host);
+ }
return host;
}