From 974f47ccb88af275d239ea6413c716047822b711 Mon Sep 17 00:00:00 2001 From: Edoardo Morandi Date: Thu, 3 Dec 2020 12:38:47 +0100 Subject: [PATCH] Update actix-files/src/path_buf.rs Perform boolean comparison before string check Co-authored-by: Rob Ede --- actix-files/src/path_buf.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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('*'));