Skip leading "/" in url querystring value

Makes it easier to rewrite :)
lighttpd-sandbox: rewrite "/cgit.cgi?url=%{enc:request.path}&%{request.query}";

Signed-off-by: Stefan Bühler <source@stbuehler.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
Stefan Bühler 2009-09-14 21:37:13 +00:00 committed by Lars Hjemli
parent 9735835c0e
commit 121898e73d
1 changed files with 2 additions and 0 deletions

2
cgit.c
View File

@ -209,6 +209,8 @@ static void querystring_cb(const char *name, const char *value)
} else if (!strcmp(name, "p")) {
ctx.qry.page = xstrdup(value);
} else if (!strcmp(name, "url")) {
if (*value == '/')
value++;
ctx.qry.url = xstrdup(value);
cgit_parse_url(value);
} else if (!strcmp(name, "qt")) {