Procházet zdrojové kódy

Auto merge of #413 - valenting:non-transitional-idna, r=SimonSapin

Switch to non-transitional IDNA

Firefox has switch over a year ago, and the URL spec as well.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/413)
<!-- Reviewable:end -->
bors-servo před 9 roky
rodič
revize
471cb945dc
2 změnil soubory, kde provedl 17 přidání a 2 odebrání
  1. 2 2
      idna/src/lib.rs
  2. 15 0
      tests/urltestdata.json

+ 2 - 2
idna/src/lib.rs

@@ -49,7 +49,7 @@ pub mod uts46;
 pub fn domain_to_ascii(domain: &str) -> Result<String, uts46::Errors> {
     uts46::to_ascii(domain, uts46::Flags {
         use_std3_ascii_rules: false,
-        transitional_processing: true, // XXX: switch when Firefox does
+        transitional_processing: false,
         verify_dns_length: false,
     })
 }
@@ -67,7 +67,7 @@ pub fn domain_to_unicode(domain: &str) -> (String, Result<(), uts46::Errors>) {
         use_std3_ascii_rules: false,
 
         // Unused:
-        transitional_processing: true,
+        transitional_processing: false,
         verify_dns_length: false,
     })
 }

+ 15 - 0
tests/urltestdata.json

@@ -3683,6 +3683,21 @@
     "search": "",
     "hash": ""
   },
+  {
+    "input": "https://faß.ExAmPlE/",
+    "base": "about:blank",
+    "href": "https://xn--fa-hia.example/",
+    "origin": "https://xn--fa-hia.example",
+    "protocol": "https:",
+    "username": "",
+    "password": "",
+    "host": "xn--fa-hia.example",
+    "hostname": "xn--fa-hia.example",
+    "port": "",
+    "pathname": "/",
+    "search": "",
+    "hash": ""
+  },
   {
     "input": "sc://faß.ExAmPlE/",
     "base": "about:blank",