1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-27 16:29:02 +02:00

Add native tls support for actix_tls::connect module (#295)

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
fakeshadow
2021-03-26 17:20:17 -07:00
committed by GitHub
parent f9262dbec0
commit bb27bac216
9 changed files with 105 additions and 9 deletions

View File

@ -170,13 +170,11 @@ impl Quoter {
idx += 1;
}
if let Some(data) = cloned {
// Unsafe: we get data from http::Uri, which does utf-8 checks already
cloned.map(|data| {
// SAFETY: we get data from http::Uri, which does UTF-8 checks already
// this code only decodes valid pct encoded values
Some(unsafe { String::from_utf8_unchecked(data) })
} else {
None
}
unsafe { String::from_utf8_unchecked(data) }
})
}
}