-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.whatwg-urlIssues and PRs related to the WHATWG URL implementation.Issues and PRs related to the WHATWG URL implementation.
Description
-
Node.js version: v12.18.3 and v14.8.0
-
Platform: Windows 10 (10.0.19041)
-
Subsystem:
url
What steps will reproduce the bug?
const url = require("url")
url.pathToFileURL("\\\\laptop\\My Documents\\FileSchemeURIs.doc")
Expected behavior
As per Microsoft's UNC URI documentation):
file://laptop/My%20Documents/FileSchemeURIs.doc
Actual behavior
URL {
href: 'file:///laptop/My%20Documents/FileSchemeURIs.doc',
origin: 'null',
protocol: 'file:',
username: '',
password: '',
host: '',
hostname: '',
port: '',
pathname: '/laptop/My%20Documents/FileSchemeURIs.doc',
search: '',
searchParams: URLSearchParams {},
hash: ''
}
-
hostname
should belaptop
(not''
). -
pathname
should be/My%20Documents/FileSchemeURIs.doc
(not be prefixed by/laptop/
).
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.whatwg-urlIssues and PRs related to the WHATWG URL implementation.Issues and PRs related to the WHATWG URL implementation.