author | Stefan Bühler <source@stbuehler.de> | 2009-09-14 21:37:13 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-10-06 16:56:43 (UTC) |
commit | 121898e73d6e28656c2d451effc6d9907ebdc5ba (patch) (side-by-side diff) | |
tree | d83e9d57cfc5b20d55b10502b832d077ae3ee076 | |
parent | 9735835c0e9f2c4a0caf5a431fc455d5855472aa (diff) | |
download | cgit-121898e73d6e28656c2d451effc6d9907ebdc5ba.zip cgit-121898e73d6e28656c2d451effc6d9907ebdc5ba.tar.gz cgit-121898e73d6e28656c2d451effc6d9907ebdc5ba.tar.bz2 |
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>
-rw-r--r-- | cgit.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -196,32 +196,34 @@ void config_cb(const char *name, const char *value) add_mimetype(name + 9, value); else if (!strcmp(name, "include")) parse_configfile(value, config_cb); } static void querystring_cb(const char *name, const char *value) { if (!value) value = ""; if (!strcmp(name,"r")) { ctx.qry.repo = xstrdup(value); ctx.repo = cgit_get_repoinfo(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")) { ctx.qry.grep = xstrdup(value); } else if (!strcmp(name, "q")) { ctx.qry.search = xstrdup(value); } else if (!strcmp(name, "h")) { ctx.qry.head = xstrdup(value); ctx.qry.has_symref = 1; } else if (!strcmp(name, "id")) { ctx.qry.sha1 = xstrdup(value); ctx.qry.has_sha1 = 1; } else if (!strcmp(name, "id2")) { ctx.qry.sha2 = xstrdup(value); ctx.qry.has_sha1 = 1; } else if (!strcmp(name, "ofs")) { |