diff --git a/actix-files/src/path_buf.rs b/actix-files/src/path_buf.rs index 9162fa8a9..dd8e5b503 100644 --- a/actix-files/src/path_buf.rs +++ b/actix-files/src/path_buf.rs @@ -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('*'));