|
|
@ -439,28 +439,29 @@ int main(int argc, const char **argv) |
|
|
|
ctx.repo = NULL; |
|
|
|
ctx.repo = NULL; |
|
|
|
http_parse_querystring(ctx.qry.raw, querystring_cb); |
|
|
|
http_parse_querystring(ctx.qry.raw, querystring_cb); |
|
|
|
|
|
|
|
|
|
|
|
/* If virtual-root isn't specified in cgitrc and no url
|
|
|
|
/* If virtual-root isn't specified in cgitrc, lets pretend
|
|
|
|
* parameter is specified on the querystring, lets pretend |
|
|
|
* that virtual-root equals SCRIPT_NAME. |
|
|
|
* that virtualroot equals SCRIPT_NAME and use PATH_INFO as |
|
|
|
|
|
|
|
* url. This allows cgit to work with virtual urls without |
|
|
|
|
|
|
|
* the need for rewriterules in the webserver (as long as |
|
|
|
|
|
|
|
* PATH_INFO is included in the cache lookup key). |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
if (!ctx.cfg.virtual_root && !ctx.qry.url) { |
|
|
|
if (!ctx.cfg.virtual_root) |
|
|
|
ctx.cfg.virtual_root = ctx.cfg.script_name; |
|
|
|
ctx.cfg.virtual_root = ctx.cfg.script_name; |
|
|
|
path = getenv("PATH_INFO"); |
|
|
|
|
|
|
|
if (path) { |
|
|
|
/* If no url parameter is specified on the querystring, lets
|
|
|
|
if (path[0] == '/') |
|
|
|
* use PATH_INFO as url. This allows cgit to work with virtual |
|
|
|
path++; |
|
|
|
* urls without the need for rewriterules in the webserver (as |
|
|
|
ctx.qry.url = xstrdup(path); |
|
|
|
* long as PATH_INFO is included in the cache lookup key). |
|
|
|
if (ctx.qry.raw) { |
|
|
|
*/ |
|
|
|
qry = ctx.qry.raw; |
|
|
|
path = getenv("PATH_INFO"); |
|
|
|
ctx.qry.raw = xstrdup(fmt("%s?%s", path, qry)); |
|
|
|
if (!ctx.qry.url && path) { |
|
|
|
free(qry); |
|
|
|
if (path[0] == '/') |
|
|
|
} else |
|
|
|
path++; |
|
|
|
ctx.qry.raw = ctx.qry.url; |
|
|
|
ctx.qry.url = xstrdup(path); |
|
|
|
cgit_parse_url(ctx.qry.url); |
|
|
|
if (ctx.qry.raw) { |
|
|
|
} |
|
|
|
qry = ctx.qry.raw; |
|
|
|
|
|
|
|
ctx.qry.raw = xstrdup(fmt("%s?%s", path, qry)); |
|
|
|
|
|
|
|
free(qry); |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
ctx.qry.raw = ctx.qry.url; |
|
|
|
|
|
|
|
cgit_parse_url(ctx.qry.url); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ttl = calc_ttl(); |
|
|
|
ttl = calc_ttl(); |
|
|
|