parent
0572de2ad0
commit
be53772337
|
@ -22,7 +22,7 @@
|
|||
<div class="entry_list">
|
||||
|
||||
<div>
|
||||
<a class="entry" href="https://example.com">../</a>
|
||||
<a class="entry" href="../">../</a>
|
||||
</div>
|
||||
|
||||
{{#each entries}}
|
||||
|
|
|
@ -257,13 +257,18 @@ pub async fn serve_all (
|
|||
|
||||
let encoded_path = &parts.uri [1..];
|
||||
|
||||
let path = percent_decode (encoded_path.as_bytes ()).decode_utf8 ().unwrap ();
|
||||
let path_s = percent_decode (encoded_path.as_bytes ()).decode_utf8 ().unwrap ();
|
||||
let path = Path::new (&*path_s);
|
||||
|
||||
let mut full_path = PathBuf::from (root);
|
||||
full_path.push (&*path);
|
||||
full_path.push (path);
|
||||
|
||||
if let Ok (dir) = read_dir (&full_path).await {
|
||||
serve_dir (handlebars, full_path.to_string_lossy (), dir).await
|
||||
serve_dir (
|
||||
handlebars,
|
||||
full_path.to_string_lossy (),
|
||||
dir
|
||||
).await
|
||||
}
|
||||
else if let Ok (file) = File::open (&full_path).await {
|
||||
serve_file (
|
||||
|
|
Loading…
Reference in New Issue