From 622e64d5f2c56543f56438cb7a705c9023bec269 Mon Sep 17 00:00:00 2001 From: Jason A. Donenfeld Date: Thu, 13 Aug 2015 11:38:27 +0200 Subject: redirect: be more careful for different cgi setups --- cmd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmd.c') diff --git a/cmd.c b/cmd.c index e86b0ea..315edc3 100644 --- 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); } -- cgit v1.2.3-70-g09d2