commit deeec27c56d8f5049abac0dad3782f5daf95a1a3
Author: Quentin Rameau <[email protected]>
AuthorDate: Fri Jan 17 14:41:55 2020 +0100
Commit: Laslo Hunhold <[email protected]>
CommitDate: Sun Jan 24 21:34:26 2021 +0100
http: fix default index serving
The previous code would find and stat the default index file,
but would not append it to the file served, resulting in
giving back a 0-length content but with a Content-Length
header of the size of the index.
diff --git a/http.c b/http.c
index dc32290..96dd540 100644
--- a/http.c
+++ b/http.c
@@ -761,6 +761,11 @@ http_prepare_response(const struct request *req, struct
response *res,
goto err;
}
}
+ /* copy the found index back to the final path */
+ if (esnprintf(res->path, sizeof(res->path), "%s", tmpuri)) {
+ s = S_REQUEST_TOO_LARGE;
+ goto err;
+ }
}
/* modified since */