diff --git a/src/Tiny_httpd_dir.ml b/src/Tiny_httpd_dir.ml index 8bf93a66..ca1fc8c5 100644 --- a/src/Tiny_httpd_dir.ml +++ b/src/Tiny_httpd_dir.ml @@ -98,7 +98,7 @@ let vfs_of_dir (top:string) : vfs = end in (module M) -let html_list_dir (module VFS:VFS) ~parent d : string = +let html_list_dir (module VFS:VFS) ~prefix ~parent d : string = let entries = VFS.list_dir d in Array.sort compare entries; let body = Buffer.create 256 in @@ -111,7 +111,7 @@ let html_list_dir (module VFS:VFS) ~parent d : string = | None -> () | Some p -> Printf.bprintf body " (parent directory) \n" - (encode_path p); + (encode_path (prefix // p)); end; Printf.bprintf body "