Merge branch 'ew/http_host'

* ew/http_host:
  use Host: header to generate cgit_hosturl
upstream
Lars Hjemli 17 years ago
commit 91fd1eca07

@ -38,6 +38,10 @@ char *cgit_hosturl()
{
char *host, *port;
host = getenv("HTTP_HOST");
if (host) {
host = xstrdup(host);
} else {
host = getenv("SERVER_NAME");
if (!host)
return NULL;
@ -46,6 +50,7 @@ char *cgit_hosturl()
host = xstrdup(fmt("%s:%d", host, atoi(port)));
else
host = xstrdup(host);
}
return host;
}

Loading…
Cancel
Save