Fix redirect for mounted folders (#2628)

A directory request without a trailing slash was redirected to the path
relative to the mount point, so /mount/dir under a mount at /mount sent
Location: //dir/ instead of /mount/dir/. Redirect to the request path
with the slash appended.
This commit is contained in:
mervindejong authored and GitHub committed 2026-10-14 15:35:27 -04:00
1 parent c419c904da
commit 924b5cecf0
2 files changed
+8 -1

No files matched your search

+1 -1
View File
@@ -13869,7 +13869,7 @@ inline bool Server::handle_file_request(Request &req, Response &res) {
detail::FileStat stat(path);
if (stat.is_dir()) {
res.set_redirect(sub_path + "/", StatusCode::MovedPermanently_301);
res.set_redirect(req.path + "/", StatusCode::MovedPermanently_301);
return true;
}