From 6f40b60bd4414b84caf6c913d82eff4be342a208 Mon Sep 17 00:00:00 2001 From: Ali MJ Al-Nasrawy Date: Tue, 4 Jan 2022 15:26:48 +0300 Subject: [PATCH] comment --- actix-files/src/path_buf.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/actix-files/src/path_buf.rs b/actix-files/src/path_buf.rs index fdd69c10c..03b2cd766 100644 --- a/actix-files/src/path_buf.rs +++ b/actix-files/src/path_buf.rs @@ -29,6 +29,8 @@ impl PathBufWrap { // equivalent to `path.split('/').count()` let mut segment_count = path.matches('/').count() + 1; + // we can decode the whole path here (instead of per-segment decoding) + // because we will reject `%2F` in paths using `segement_count`. let path = percent_encoding::percent_decode_str(path) .decode_utf8() .map_err(|_| UriSegmentError::NotValidUtf8)?;