mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-05 19:00:32 -05:00
fixes in dir module
This commit is contained in:
parent
6706589c62
commit
d5c828978d
1 changed files with 2 additions and 2 deletions
|
|
@ -117,7 +117,7 @@ let html_list_dir (module VFS:VFS) ~prefix ~parent d : Html.elt =
|
|||
begin match parent with
|
||||
| None -> ()
|
||||
| Some p ->
|
||||
out @< a[A.href (encode_path (prefix // p))][txt"(parent directory)"];
|
||||
out @< a[A.href (encode_path ("/" // prefix // p))][txt"(parent directory)"];
|
||||
end;
|
||||
|
||||
out @< ul'[] @@ fun out ->
|
||||
|
|
@ -242,7 +242,7 @@ let add_vfs_ ~on_fs ~top ~config ~vfs:((module VFS:VFS) as vfs) ~prefix server :
|
|||
) else if VFS.is_directory path then (
|
||||
S._debug (fun k->k "list dir %S (topdir %S)" path VFS.descr);
|
||||
let parent = Filename.(dirname path) in
|
||||
let parent = if parent <> "." && parent <> path then Some parent else None in
|
||||
let parent = if path <> "." then Some parent else None in
|
||||
match config.dir_behavior with
|
||||
| Index | Index_or_lists when VFS.contains (path // "index.html") ->
|
||||
(* redirect using path, not full path *)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue