Redirect directory requests to dirplex to always include a trailing slash.
[ashd.git] / src / dirplex.c
index c612c15..699819f 100644 (file)
@@ -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;