From: Fredrik Tolf Date: Tue, 24 Aug 2010 19:40:24 +0000 (+0200) Subject: Redirect directory requests to dirplex to always include a trailing slash. X-Git-Tag: 0.1~84 X-Git-Url: http://www.dolda2000.com/gitweb/?p=ashd.git;a=commitdiff_plain;h=755faed02a98d53ed7dd2889e36f177d926f4638 Redirect directory requests to dirplex to always include a trailing slash. --- diff --git a/src/dirplex.c b/src/dirplex.c index c612c15..699819f 100644 --- a/src/dirplex.c +++ b/src/dirplex.c @@ -413,6 +413,10 @@ static void serve(struct hthead *req, int fd) else path = sprintf2("%s/%s", path, p); free(tmp); + if(p2 == NULL) { + stdredir(req, fd, 301, sprintf3("%s/", p)); + goto out; + } if(checkdir(req, fd, path)) break; goto next;