-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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.pathToFileURL doesn't generate valid URLs for UNC paths #34736
Comments
This sounds like a valid bug to me. The implementation is at https://github.com/nodejs/node/blob/master/lib/internal/url.js#L1368 where it seems clear this isn't properly being taken into account. |
I'd be happy to swing at it, I haven't committed to node yet. |
That would be really great, please feel free if you can. I believe that on posix machines such a path should be ignored, like for other path functions I believe. Building for Windows is documented at https://github.com/nodejs/node/blob/master/BUILDING.md#windows. |
(interestingly enough, |
Do you want |
Shouldn't need a new error code. Using one like |
I'm not sure what would be best - I don't think we currently do path validations, but if there is no adequate URL representation that would support |
Node.js version: v12.18.3 and v14.8.0
Platform: Windows 10 (10.0.19041)
Subsystem:
url
What steps will reproduce the bug?
Expected behavior
As per Microsoft's UNC URI documentation):
file://laptop/My%20Documents/FileSchemeURIs.doc
Actual behavior
hostname
should belaptop
(not''
).pathname
should be/My%20Documents/FileSchemeURIs.doc
(not be prefixed by/laptop/
).The text was updated successfully, but these errors were encountered: