mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
doc: update url.origin IDNA behavior
Fixes: 413691fde0 "url: expose WHATWG url.origin as ASCII"
PR-URL: https://github.com/nodejs/node/pull/14478
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
1 file changed
+2
-4
+2
-4
@@ -211,9 +211,7 @@ will be thrown.
|
||||
|
||||
* {string}
|
||||
|
||||
Gets the read-only serialization of the URL's origin. Unicode characters that
|
||||
may be contained within the hostname will be encoded as-is without [Punycode][]
|
||||
encoding.
|
||||
Gets the read-only serialization of the URL's origin.
|
||||
|
||||
```js
|
||||
const { URL } = require('url');
|
||||
@@ -226,7 +224,7 @@ console.log(myURL.origin);
|
||||
const { URL } = require('url');
|
||||
const idnURL = new URL('https://你好你好');
|
||||
console.log(idnURL.origin);
|
||||
// Prints https://你好你好
|
||||
// Prints https://xn--6qqa088eba
|
||||
|
||||
console.log(idnURL.hostname);
|
||||
// Prints xn--6qqa088eba
|
||||
|
||||
Reference in new issue
Block a user