From 66973ac237bf97f318717f478b3643c7b6352afb Mon Sep 17 00:00:00 2001 From: "Clifford T. Matthews" Date: Sun, 23 Feb 2020 11:51:15 -0700 Subject: [PATCH] Remove limitation that prohibits segments from starting with '.' The path "/.well-known", can be handy to use with Let's Encrypt, due to the requirements of https://tools.ietf.org/html/rfc8555 which inherits that name from https://tools.ietf.org/html/rfc5785 This commit removes the restriction that prevents actix-files::Files from serving files from paths that contain a segment that starts with a leading '.' --- actix-files/src/lib.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/actix-files/src/lib.rs b/actix-files/src/lib.rs index d910b7d5f..cc09a37a6 100644 --- a/actix-files/src/lib.rs +++ b/actix-files/src/lib.rs @@ -605,8 +605,6 @@ impl PathBufWrp { for segment in path.split('/') { if segment == ".." { buf.pop(); - } else if segment.starts_with('.') { - return Err(UriSegmentError::BadStart('.')); } else if segment.starts_with('*') { return Err(UriSegmentError::BadStart('*')); } else if segment.ends_with(':') { @@ -1397,10 +1395,6 @@ mod tests { #[actix_rt::test] async fn test_path_buf() { - assert_eq!( - PathBufWrp::get_pathbuf("/test/.tt").map(|t| t.0), - Err(UriSegmentError::BadStart('.')) - ); assert_eq!( PathBufWrp::get_pathbuf("/test/*tt").map(|t| t.0), Err(UriSegmentError::BadStart('*'))