diff --git a/idna/src/uts46.rs b/idna/src/uts46.rs index ac348d1fa..32a4a8399 100644 --- a/idna/src/uts46.rs +++ b/idna/src/uts46.rs @@ -130,7 +130,7 @@ fn passes_bidi(label: &str, is_bidi_domain: bool) -> bool { match first_char_class { // LTR label - BidiClass::L => { + BidiClass::L | BidiClass::EN => { // Rule 5 loop { match chars.next() { diff --git a/tests/unit.rs b/tests/unit.rs index 62401c943..ad60b1411 100644 --- a/tests/unit.rs +++ b/tests/unit.rs @@ -226,6 +226,8 @@ fn test_idna() { assert!("http://goșu.ro".parse::().is_ok()); assert_eq!(Url::parse("http://☃.net/").unwrap().host(), Some(Host::Domain("xn--n3h.net"))); assert!("https://r2---sn-huoa-cvhl.googlevideo.com/crossdomain.xml".parse::().is_ok()); + // https://github.com/servo/rust-url/issues/489 + assert!("http://mail.163.com.xn----9mcjf9b4dbm09f.com/iloystgnjfrgthteawvo/indexx.php".parse::().is_ok()); } #[test]