summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2021-06-12 19:18:00 -0300
committerSoniEx2 <endermoneymod@gmail.com>2021-06-12 19:18:00 -0300
commit698402eab950622464d3e876d60d7a02eb5ab358 (patch)
treeae6f3c35bb1ca14397dfd328bf0ef9b419c370f2
parent57376180c9d01e293c79c1fdd846ec46c156a3d0 (diff)
Normalize empty paths
-rw-r--r--src/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 31c7aa9..a6c16d9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -92,6 +92,10 @@ pub fn serve(archive: &'static str) -> Server {
let mut current = Some(Archive::new(archive.clone()));
let mut response = None;
for part in path_parts {
+ // normalize foo//bar == foo/bar
+ if part.is_empty() {
+ continue
+ }
if response.is_some() {
// didn't run out of path_parts but somehow we
// found a valid response. invalidate it.