-rw-r--r-- | ui-shared.c | 5 |
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() | |||
39 | char *host, *port; | 39 | char *host, *port; |
40 | 40 | ||
41 | host = getenv("HTTP_HOST"); | ||
42 | if (host) { | ||
43 | host = xstrdup(host); | ||
44 | } else { | ||
41 | host = getenv("SERVER_NAME"); | 45 | host = getenv("SERVER_NAME"); |
42 | if (!host) | 46 | if (!host) |
@@ -47,4 +51,5 @@ char *cgit_hosturl() | |||
47 | else | 51 | else |
48 | host = xstrdup(host); | 52 | host = xstrdup(host); |
53 | } | ||
49 | return host; | 54 | return host; |
50 | } | 55 | } |