-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
WHATWG URL API format() function inserts '//' wrongly when 'unicode' is set #48759
Comments
@nodejs/url cc |
At a glance, @jribbens is likely correct. The ada library returns the empty string when calling So it should be... if (unicode && out->has_hostname()) {
out->host = ada::idna::to_unicode(out->get_hostname());
} |
Xstoudi
added a commit
to Xstoudi/node
that referenced
this issue
Aug 9, 2023
nodejs-github-bot
pushed a commit
that referenced
this issue
Aug 31, 2023
PR-URL: #49396 Fixes: #48759 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
UlisesGascon
pushed a commit
that referenced
this issue
Sep 10, 2023
PR-URL: #49396 Fixes: #48759 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
alexfernandez
pushed a commit
to alexfernandez/node
that referenced
this issue
Nov 1, 2023
PR-URL: nodejs#49396 Fixes: nodejs#48759 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
targos
pushed a commit
that referenced
this issue
Nov 27, 2023
PR-URL: #49396 Fixes: #48759 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
sercher
added a commit
to sercher/graaljs
that referenced
this issue
Apr 25, 2024
PR-URL: nodejs/node#49396 Fixes: nodejs/node#48759 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
sercher
added a commit
to sercher/graaljs
that referenced
this issue
Apr 25, 2024
PR-URL: nodejs/node#49396 Fixes: nodejs/node#48759 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
v18.16.1
Platform
Linux foo 6.2.0-25-generic #25-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 16 17:05:07 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
url
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
100% reproducible
What is the expected behavior? Why is that the expected behavior?
The
//
characters should not be being inserted.Three reasons why:
unicode
flag should not be changing the output of the URLs I showtel:
URL syntax (for example) never starts with//
What do you see instead?
URLs that are not in the
slashedProtocol
set should not be having//
added to them.Additional information
From manual inspection of the code, I am guessing that node/src/node_url.cc line 198 onwards is the issue:
I guess that
ada::idna::to_unicode
is transforming the hostname from a falsey value to an empty but truthy value and henceget_href
is adding in the//
. Perhaps the above lines should be checking that there actually is a hostname, before updatingout->host
.The text was updated successfully, but these errors were encountered: