-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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: ensure host setter matches parse for file url #10615
Conversation
It'd be ideal if these tests were in the urltestdata.json and url_setters.json files (or in some kind of urltestdata-to-upstream.json supplement) so they could be upstreamed and shared among all implementations. |
Yeah, I'd considered that but wanted to hold off just a bit before doing so until there was more clarity on what the expected spec changes will be. Validating the current underspecified behavior does not seem too worthwhile since there are variances among the implementations on how to handle it |
That said, there's no reason not to add them to our own copies of those files ;-) |
Yeah, in jsdom/whatwg-url we have a to-upstream/urltestdata.json which we run, in addition to the official urltestdata.json (which we download in the pretest script from a known hash). Then we periodically go through and send PRs to web-platform-tests, and when they're accepted, empty out to-upstream/urltestdata.json. |
Ok, added a commit that adds the additional tests to the files. The file names are different but the patch should apply clean once adjusted for the file path differences. |
cc @nodejs/url |
Is this ready to be reviewed? Or do we wait until the spec changes land? |
Waiting for spec changes. This pr is incomplete
…On Fri, Jan 13, 2017 at 10:41 PM Joyee Cheung ***@***.***> wrote:
Is this ready to be reviewed? Or do we wait until the spec changes land?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10615 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAa2efe_JCeJ87p4awLyG-LOp4Vjeu2gks5rSG4TgaJpZM4La624>
.
|
@jasnell Could you please rebase this to review? |
Technically, file URLs are not permitted to have a port. There is currently an ambiguity in the URL spec. In the current spec having a port in a file URL is undefined behavior. In the current implementation, the port is ignored and handled as if it were part of the host name. This will be changing once the ambiguity is resolved in the spec. The spec change may involve either ignoring the port if specified or throwing with an Invalid URL error if the port is specified. For now, this test verifies the currently implemented behavior. Fixes: nodejs#10608
d1f69c7
to
c8b2f55
Compare
@watilde ... rebased! |
This should be made obsoleted by #12523, which adds similar logic in the C++ layer. |
@TimothyGu ... happy to close this! Looking forward to #12523 landing! |
Technically, file URLs are not permitted to have a port. There is
currently an ambiguity in the URL spec. In the current spec
having a port in a file URL is undefined behavior. In the current
implementation, the port is ignored and handled as if it were part
of the host name. This will be changing once the ambiguity is
resolved in the spec. The spec change may involve either ignoring the
port if specified or throwing with an Invalid URL error if the port
is specified. For now, this test verifies the currently implemented
behavior.
Fixes: #10608
/cc @domenic
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
url