mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 04:29:02 -04:00
redirect to /uri/ if need be.
This commit is contained in:
parent
04f4306cf2
commit
e665cc900d
@ -259,6 +259,14 @@ lookup:
|
||||
fd = -1;
|
||||
}
|
||||
} else if (S_ISDIR(st.st_mode) && index == 0) {
|
||||
if (req->path[strlen(req->path) - 1] != '/') {
|
||||
(void)snprintf(fpath,
|
||||
sizeof(fpath), "%s/", req->path);
|
||||
http_response_header(req, "location", fpath);
|
||||
http_response(req, HTTP_STATUS_FOUND, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
len = snprintf(fpath, sizeof(fpath),
|
||||
"%s/%s%s", map->ondisk, path,
|
||||
kore_filemap_index != NULL ?
|
||||
|
Loading…
x
Reference in New Issue
Block a user