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()) } }