From 56bba3202927b91c8947d32c385d3f58cfaf4f76 Mon Sep 17 00:00:00 2001 From: Ali MJ Al-Nasrawy Date: Thu, 3 Jun 2021 15:45:14 +0300 Subject: [PATCH] fix --- actix-router/src/url.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/actix-router/src/url.rs b/actix-router/src/url.rs index e4522e5b..130ac76f 100644 --- a/actix-router/src/url.rs +++ b/actix-router/src/url.rs @@ -170,11 +170,7 @@ impl Quoter { idx += 1; } - cloned.map(|data| { - // SAFETY: we get data from http::Uri, which does UTF-8 checks already - // this code only decodes valid pct encoded values - unsafe { String::from_utf8_unchecked(data) } - }) + cloned.map(|data| String::from_utf8_lossy(&data).into_owned()) } }