diff options
author | Vamist <personal@vamist.dev> | 2022-12-06 11:10:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-06 11:10:37 +0000 |
commit | 1911f7c8206146aa02dc6f7870d0b8fb83db0f56 (patch) | |
tree | 789ac8d2c41080aa1b1ee8db3bfb8f8e428b9f5e | |
parent | Bump deps (diff) | |
download | miniserve-1911f7c8206146aa02dc6f7870d0b8fb83db0f56.tar.gz miniserve-1911f7c8206146aa02dc6f7870d0b8fb83db0f56.zip |
[fix] Sorting breaks subdir downloading
- Small check in render.rs make_link_with_trailing_slash to return nothing if link is empty, instead of adding a /
Diffstat (limited to '')
-rw-r--r-- | src/renderer.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/renderer.rs b/src/renderer.rs index 5ba69a2..155dfe3 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -411,7 +411,7 @@ fn archive_button( /// Ensure that there's always a trailing slash behind the `link`. fn make_link_with_trailing_slash(link: &str) -> String { - if link.ends_with('/') { + if link.is_empty() || link.ends_with('/') { link.to_string() } else { format!("{}/", link) |