فهرست منبع

Change quirks::origin to return ASCII serialization

Valentin Gosu 9 سال پیش
والد
کامیت
8f56ac866d
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      src/quirks.rs
  2. 1 1
      tests/urltestdata.json

+ 1 - 1
src/quirks.rs

@@ -46,7 +46,7 @@ pub fn set_href(url: &mut Url, value: &str) -> Result<(), ParseError> {
 
 
 /// Getter for https://url.spec.whatwg.org/#dom-url-origin
 /// Getter for https://url.spec.whatwg.org/#dom-url-origin
 pub fn origin(url: &Url) -> String {
 pub fn origin(url: &Url) -> String {
-    url.origin().unicode_serialization()
+    url.origin().ascii_serialization()
 }
 }
 
 
 /// Getter for https://url.spec.whatwg.org/#dom-url-protocol
 /// Getter for https://url.spec.whatwg.org/#dom-url-protocol

+ 1 - 1
tests/urltestdata.json

@@ -3536,7 +3536,7 @@
     "input": "http://你好你好",
     "input": "http://你好你好",
     "base": "http://other.com/",
     "base": "http://other.com/",
     "href": "http://xn--6qqa088eba/",
     "href": "http://xn--6qqa088eba/",
-    "origin": "http://你好你好",
+    "origin": "http://xn--6qqa088eba",
     "protocol": "http:",
     "protocol": "http:",
     "username": "",
     "username": "",
     "password": "",
     "password": "",