aboutsummaryrefslogtreecommitdiff
path: root/src/uri.rs
diff options
context:
space:
mode:
authorRichard Walters <rwalters@digitalstirling.com>2020-10-15 12:44:14 -0700
committerRichard Walters <rwalters@digitalstirling.com>2020-10-15 12:44:14 -0700
commit170b711d710a0572fbd396c29be6647a5dcf3836 (patch)
treea44d522584e303114d5d7ec140069b295f28e546 /src/uri.rs
parent96d8c0d50c3c583a0cfaab749bf73743de1afe9c (diff)
Version 1.0.1
* Fixed bug in percent encoding of characters \x0 through \xF where they were encoded as "%0" through "%F" rather than "%00" through "%0F".
Diffstat (limited to 'src/uri.rs')
-rw-r--r--src/uri.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/uri.rs b/src/uri.rs
index b9e7266..b49cb96 100644
--- a/src/uri.rs
+++ b/src/uri.rs
@@ -1485,6 +1485,18 @@ mod tests {
}
#[test]
+ fn percent_encode_characters_with_two_digits_always() {
+ for ci in 0_u8..31_u8 {
+ let mut uri = Uri::default();
+ uri.set_query(Some(vec![ci]));
+ assert_eq!(
+ uri.to_string(),
+ format!("?%{:02X}", ci)
+ );
+ }
+ }
+
+ #[test]
fn set_illegal_schemes() {
let test_vectors = [
"ab_de",