Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url: WHATWG API .origin behavior does not match the documentation #22653

Closed
ChALkeR opened this issue Sep 2, 2018 · 3 comments
Closed

url: WHATWG API .origin behavior does not match the documentation #22653

ChALkeR opened this issue Sep 2, 2018 · 3 comments
Labels
doc Issues and PRs related to the documentations. whatwg-url Issues and PRs related to the WHATWG URL implementation.

Comments

@ChALkeR
Copy link
Member

ChALkeR commented Sep 2, 2018

  • Version: v10.9.0, v11.0.0-pre (master)
  • Platform: Linux yoga 4.18.5-arch1-1-ARCH #1 SMP PREEMPT Fri Aug 24 12:48:58 UTC 2018 x86_64 GNU/Linux
  • Subsystem: doc, url

Documented (link):

const myURL = new URL('https://%CF%80.com/foo');
console.log(myURL.href);
// Prints https://xn--1xa.com/foo
console.log(myURL.origin);
// Prints https://π.com

Actual behavior:

> const myURL = new URL('https://%CF%80.com/foo');
> console.log(myURL.href);
https://xn--1xa.com/foo
> console.log(myURL.origin);
https://xn--1xa.com

The doc implies that .origin is not punicode-encoded in this scenario, but it in fact is punicode-encoded.

@ChALkeR ChALkeR added doc Issues and PRs related to the documentations. whatwg-url Issues and PRs related to the WHATWG URL implementation. labels Sep 2, 2018
@ChALkeR ChALkeR changed the title url: WHATWG API .origin behavior does not match with documentation url: WHATWG API .origin behavior does not match the documentation Sep 2, 2018
@TimothyGu
Copy link
Member

Yeah, this needs a documentation update. We changed the behavior a while ago to reflect a spec change.

@ChALkeR
Copy link
Member Author

ChALkeR commented Sep 2, 2018

@TimothyGu I can include a fix then, I have some minor fixes to url.md planned and this is how I spotted that inconsistency.

ChALkeR added a commit to ChALkeR/io.js that referenced this issue Oct 10, 2018
Fixes one WHATWG URL example to match the actual behavior.

Fixes: nodejs#22653
@ChALkeR
Copy link
Member Author

ChALkeR commented Oct 12, 2018

#23359 should fix it, I believe.

@danbev danbev closed this as completed in 3b1baf6 Oct 15, 2018
jasnell pushed a commit that referenced this issue Oct 17, 2018
Fixes one WHATWG URL example to match the actual behavior.

PR-URL: #23359
Fixes: #22653
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit that referenced this issue Oct 20, 2018
Fixes one WHATWG URL example to match the actual behavior.

PR-URL: #23359
Fixes: #22653
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this issue Oct 30, 2018
Fixes one WHATWG URL example to match the actual behavior.

PR-URL: #23359
Fixes: #22653
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
rvagg pushed a commit that referenced this issue Nov 28, 2018
Fixes one WHATWG URL example to match the actual behavior.

PR-URL: #23359
Fixes: #22653
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this issue Nov 29, 2018
Fixes one WHATWG URL example to match the actual behavior.

PR-URL: #23359
Fixes: #22653
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. whatwg-url Issues and PRs related to the WHATWG URL implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants