Uh oh!
There was an error while loading. Please reload this page.
url: return valid file: urls fom url.format() - #7234
Conversation
jasnell
commented
Jun 8, 2016
There was a problem hiding this comment.
minor nit: last time i checked template strings had noticeable overhead, may need to check again on master now.
There was a problem hiding this comment.
Changed to string concatenation.
`file:` URLs that do not start with `file://` are invalid. Browsers convert `file:/etc/passwd` to `file:///etc/passwd`. This is also what the docs indicate we are doing, but we're not. Fixes: nodejs#3361
Trott
commented
Jun 10, 2016
/cc @silverwind@claudiorodriguez (who had substantial comments on the issue this tries to address) |
Trott
commented
Jun 10, 2016
silverwind
commented
Jun 10, 2016
LGTM if CI passes. |
Trott
commented
Jun 10, 2016
I guess since it's semver-major and our docs say that semver-major changes need to be reviewed in some fashion by CTC: @nodejs/ctc |
Trott
commented
Jun 10, 2016
Couple of unrelated-seeming issues on that first CI run. Here's a second one: https://ci.nodejs.org/job/node-test-commit/3707/ |
mscdex
commented
Jun 10, 2016
LGTM |
Trott
commented
Jun 10, 2016
@jasnell This would seem to be orthogonal to nodejs/node-eps#28 but uh, just in case, care to review? |
| pathname = '/' + pathname; | ||
| host = '//' + host; | ||
| } else if (protocol.length >= 4 && | ||
| protocol.charCodeAt(0) === 102/*f*/ && |
There was a problem hiding this comment.
@indutny I used decimal because:
- It's decimal in most of the existing
charCodeAt()calls, including ~10 lines later in lines 621 and 622, as well as theswitchstatement ~30 lines earlier starting on line 581. - The sample code (provided by @mscdex) used decimal and I did a lazy copy/paste.
I don't feel strongly about it, though, and I'm happy to change it to hex format if that's the difference between a quick LGTM and a not-sure-about-this.
Trott
commented
Jun 13, 2016
Trying to get more eyes on this... @nodejs/collaborators |
Trott
commented
Jun 14, 2016
Adding |
For anyone here wondering what whatwg-url spec does, ref: https://url.spec.whatwg.org/#url-serializing. It always starts |
rvagg
commented
Jun 15, 2016
no objections from ctc |
`file:` URLs that do not start with `file://` are invalid. Browsers convert `file:/etc/passwd` to `file:///etc/passwd`. This is also what the docs indicate we are doing, but we're not. PR-URL: nodejs#7234Fixes: nodejs#3361 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brian White <mscdex@mscdex.net>
Trott
commented
Jun 16, 2016
Landed in 336b027 |
Checklist
make -j4 test(UNIX) orvcbuild test nosign(Windows) passesAffected core subsystem(s)
url
Description of change
file:URLs that do not start withfile://are invalid. Browsers convertfile:/etc/passwdtofile:///etc/passwd. This is also what the docs indicate we are doing, but we're not.Labeling
semver-majorbecause tests have to be updated for it.Fixes: #3361