-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
atlowChemi
added
whatwg-url
Issues and PRs related to the WHATWG URL implementation.
url
Issues and PRs related to the legacy built-in url module.
and removed
whatwg-url
Issues and PRs related to the WHATWG URL implementation.
labels
Jul 14, 2023
@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
anonrig
added
the
v18.x
Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.
label
Aug 28, 2023
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 <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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: