diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2020-03-01 06:50:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-01 06:50:21 +0000 |
commit | dbe645d1a0a581286d8b6fcf0c6e7d9c2ca0ebca (patch) | |
tree | 45c5a582ed5017c6a4acf0182d03a854dc60da70 /src | |
parent | Merge pull request #189 from efx/fix-156 (diff) | |
parent | Compare paths instead of strings (diff) | |
download | miniserve-dbe645d1a0a581286d8b6fcf0c6e7d9c2ca0ebca.tar.gz miniserve-dbe645d1a0a581286d8b6fcf0c6e7d9c2ca0ebca.zip |
Merge pull request #219 from ghost/path-comparison
Compare paths instead of strings
Diffstat (limited to 'src')
-rw-r--r-- | src/listing.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/listing.rs b/src/listing.rs index 42eb59a..d419775 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -152,7 +152,7 @@ pub fn directory_listing<S>( let base = Path::new(serve_path); let random_route = format!("/{}", random_route.unwrap_or_default()); - let is_root = base.parent().is_none() || req.path() == random_route; + let is_root = base.parent().is_none() || Path::new(&req.path()) == Path::new(&random_route); let current_dir = match base.strip_prefix(random_route) { Ok(c_d) => Path::new("/").join(c_d), Err(_) => base.to_path_buf(), |