mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -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
|
begin match parent with
|
||||||
| None -> ()
|
| None -> ()
|
||||||
| Some p ->
|
| 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;
|
end;
|
||||||
|
|
||||||
out @< ul'[] @@ fun out ->
|
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 (
|
) else if VFS.is_directory path then (
|
||||||
S._debug (fun k->k "list dir %S (topdir %S)" path VFS.descr);
|
S._debug (fun k->k "list dir %S (topdir %S)" path VFS.descr);
|
||||||
let parent = Filename.(dirname path) in
|
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
|
match config.dir_behavior with
|
||||||
| Index | Index_or_lists when VFS.contains (path // "index.html") ->
|
| Index | Index_or_lists when VFS.contains (path // "index.html") ->
|
||||||
(* redirect using path, not full path *)
|
(* redirect using path, not full path *)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue