From 755faed02a98d53ed7dd2889e36f177d926f4638 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Tue, 24 Aug 2010 21:40:24 +0200 Subject: [PATCH] Redirect directory requests to dirplex to always include a trailing slash. --- src/dirplex.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.11.0