mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
Index seems not to work wirg non empty prefix
Here is a proposed fix ?
This commit is contained in:
parent
a3f27bd3cb
commit
45f73ee79c
1 changed files with 1 additions and 1 deletions
|
|
@ -247,7 +247,7 @@ let add_vfs_ ~on_fs ~top ~config ~vfs:((module VFS:VFS) as vfs) ~prefix server :
|
|||
match config.dir_behavior with
|
||||
| Index | Index_or_lists when VFS.contains (path // "index.html") ->
|
||||
(* redirect using path, not full path *)
|
||||
let new_path = "/" // path // "index.html" in
|
||||
let new_path = "/" // prefix // path // "index.html" in
|
||||
S._debug (fun k->k "redirect to `%s`" new_path);
|
||||
S.Response.make_raw ~code:301 ""
|
||||
~headers:S.Headers.(empty |> set "location" new_path)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue