mirror of https://github.com/fafhrd91/actix-web
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:
parent
24f71b99f9
commit
974f47ccb8
|
@ -27,7 +27,7 @@ impl PathBufWrap {
|
||||||
for segment in path.split('/') {
|
for segment in path.split('/') {
|
||||||
if segment == ".." {
|
if segment == ".." {
|
||||||
buf.pop();
|
buf.pop();
|
||||||
} else if segment.starts_with('.') && !hidden_files {
|
} else if !hidden_files && segment.starts_with('.') {
|
||||||
return Err(UriSegmentError::BadStart('.'));
|
return Err(UriSegmentError::BadStart('.'));
|
||||||
} else if segment.starts_with('*') {
|
} else if segment.starts_with('*') {
|
||||||
return Err(UriSegmentError::BadStart('*'));
|
return Err(UriSegmentError::BadStart('*'));
|
||||||
|
|
Loading…
Reference in New Issue