neocgit

a more 'modern' version of cgit
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/neocgit

commit 622e64d5f2c56543f56438cb7a705c9023bec269
parent da1d4c77760ff6a0eb5cbfbaf6956930089d1963
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Thu, 13 Aug 2015 11:38:27 +0200

redirect: be more careful for different cgi setups

Diffstat:
Mcmd.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cmd.c b/cmd.c @@ -46,7 +46,10 @@ static void about_fn(void) static void about_pre(void) { - if (ctx.repo && !ctx.qry.path && ctx.qry.url[strlen(ctx.qry.url) - 1] != '/') + if (ctx.repo && + !ctx.qry.path && + ctx.qry.url[strlen(ctx.qry.url) - 1] != '/' && + ctx.env.path_info[strlen(ctx.env.path_info) - 1] != '/') cgit_redirect(fmtalloc("%s/", cgit_currenturl()), true); }