diff --git a/src/Tiny_httpd_dir.ml b/src/Tiny_httpd_dir.ml index b7fe7956..ce09aa94 100644 --- a/src/Tiny_httpd_dir.ml +++ b/src/Tiny_httpd_dir.ml @@ -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 *)