Update actix-files/src/path_buf.rs

Perform boolean comparison before string check

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
Edoardo Morandi 2020-12-03 12:38:47 +01:00 committed by GitHub
parent 24f71b99f9
commit 974f47ccb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ impl PathBufWrap {
for segment in path.split('/') {
if segment == ".." {
buf.pop();
} else if segment.starts_with('.') && !hidden_files {
} else if !hidden_files && segment.starts_with('.') {
return Err(UriSegmentError::BadStart('.'));
} else if segment.starts_with('*') {
return Err(UriSegmentError::BadStart('*'));