diff options
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 9 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | TEST_MAPPING | 18 | ||||
-rw-r--r-- | src/punycode.rs | 4 | ||||
-rw-r--r-- | src/uts46.rs | 1 | ||||
-rw-r--r-- | tests/unit.rs | 6 |
9 files changed, 30 insertions, 22 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 9926491..0eb4358 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "5e929762c9319f4f5b8d0311c920a9069d3d2e10" + "sha1": "837538c549f3458f157ee154ae76e3e2b9e27118" } } @@ -41,6 +41,8 @@ rust_library { name: "libidna", host_supported: true, crate_name: "idna", + cargo_env_compat: true, + cargo_pkg_version: "0.2.3", srcs: ["src/lib.rs"], edition: "2018", rustlibs: [ @@ -54,10 +56,3 @@ rust_library { ], min_sdk_version: "29", } - -// dependent_library ["feature_list"] -// matches-0.1.8 -// tinyvec-1.2.0 "alloc,default,tinyvec_macros" -// tinyvec_macros-0.1.0 -// unicode-bidi-0.3.5 "default" -// unicode-normalization-0.1.17 "default,std" @@ -13,7 +13,7 @@ [package] edition = "2018" name = "idna" -version = "0.2.2" +version = "0.2.3" authors = ["The rust-url developers"] autotests = false description = "IDNA (Internationalizing Domain Names in Applications) and Punycode." diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 8aba16d..6b3750b 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "idna" -version = "0.2.2" +version = "0.2.3" authors = ["The rust-url developers"] description = "IDNA (Internationalizing Domain Names in Applications) and Punycode." repository = "https://github.com/servo/rust-url/" @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/idna/idna-0.2.2.crate" + value: "https://static.crates.io/crates/idna/idna-0.2.3.crate" } - version: "0.2.2" + version: "0.2.3" license_type: NOTICE last_upgrade_date { year: 2021 - month: 4 - day: 1 + month: 5 + day: 19 } } diff --git a/TEST_MAPPING b/TEST_MAPPING index 5da7ae4..407ec5c 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -1,17 +1,21 @@ // Generated by update_crate_tests.py for tests that depend on this crate. { - "presubmit": [ + "imports": [ { - "name": "url_device_test_tests_unit" + "path": "external/rust/crates/quiche" }, { - "name": "url_device_test_tests_data" - }, + "path": "external/rust/crates/url" + } + ], + "presubmit": [ { - "name": "url_device_test_src_lib" - }, + "name": "doh_unit_test" + } + ], + "presubmit-rust": [ { - "name": "quiche_device_test_src_lib" + "name": "doh_unit_test" } ] } diff --git a/src/punycode.rs b/src/punycode.rs index a237504..21955f3 100644 --- a/src/punycode.rs +++ b/src/punycode.rs @@ -78,6 +78,10 @@ impl Decoder { ), }; + if !base.is_ascii() { + return Err(()); + } + let base_len = base.len(); let mut length = base_len as u32; let mut code_point = INITIAL_N; diff --git a/src/uts46.rs b/src/uts46.rs index 0b7d27a..ad79805 100644 --- a/src/uts46.rs +++ b/src/uts46.rs @@ -309,7 +309,6 @@ fn check_validity(label: &str, config: Config, errors: &mut Errors) { _ => true, }) { errors.invalid_mapping = true; - return; } // V7: ContextJ rules diff --git a/tests/unit.rs b/tests/unit.rs index 84a9d54..297c8cf 100644 --- a/tests/unit.rs +++ b/tests/unit.rs @@ -131,3 +131,9 @@ fn emoji_domains() { let error = format!("{:?}", config.to_ascii("☕.com").unwrap_err()); assert!(error.contains("disallowed_in_idna_2008")); } + +#[test] +fn unicode_before_delimiter() { + let config = idna::Config::default(); + assert!(config.to_ascii("xn--f\u{34a}-PTP").is_err()); +} |