diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2021-06-12 19:18:00 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2021-06-12 19:18:00 -0300 |
commit | 698402eab950622464d3e876d60d7a02eb5ab358 (patch) | |
tree | ae6f3c35bb1ca14397dfd328bf0ef9b419c370f2 /src | |
parent | 57376180c9d01e293c79c1fdd846ec46c156a3d0 (diff) |
Normalize empty paths
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 4 |
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. |