Przeglądaj źródła

Auto merge of #402 - valenting:ascii-origin, r=SimonSapin

Change quirks::origin to return ASCII serialization

This is to reflect the following change in the URL Standard:
https://github.com/whatwg/url/commit/20c3257194db218c47526ba4ef4894a09e3847c9

<!-- 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/402)
<!-- Reviewable:end -->
bors-servo 9 lat temu
rodzic
commit
8c55c50f83
2 zmienionych plików z 2 dodań i 2 usunięć
  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": "",