|
|
@ -54,14 +54,14 @@ const char *cgit_httpscheme(void)
|
|
|
|
return "http://";
|
|
|
|
return "http://";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const char *cgit_hosturl(void)
|
|
|
|
char *cgit_hosturl(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (ctx.env.http_host)
|
|
|
|
if (ctx.env.http_host)
|
|
|
|
return ctx.env.http_host;
|
|
|
|
return xstrdup(ctx.env.http_host);
|
|
|
|
if (!ctx.env.server_name)
|
|
|
|
if (!ctx.env.server_name)
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
if (!ctx.env.server_port || atoi(ctx.env.server_port) == 80)
|
|
|
|
if (!ctx.env.server_port || atoi(ctx.env.server_port) == 80)
|
|
|
|
return ctx.env.server_name;
|
|
|
|
return xstrdup(ctx.env.server_name);
|
|
|
|
return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port);
|
|
|
|
return fmtalloc("%s:%s", ctx.env.server_name, ctx.env.server_port);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|