-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Description
Version
22.5.1
Platform
Microsoft Windows NT 10.0.22631.0 x64
Subsystem
No response
What steps will reproduce the bug?
const { pathToFileURL } = require('url');
console.log(pathToFileURL('\\\\?\\UNC\\server\\share\\folder\\file.txt').href);
// output: 'file:///UNC/server/share/folder/file.txt'
How often does it reproduce? Is there a required condition?
Anytime
What is the expected behavior? Why is that the expected behavior?
According to the Microsoft documentation on maximum file path limitations, the \?\UNC\ prefix are not used as part of the path itself. so it should be ignored when converting to a file URI. The current implementation does not adhere to this guideline, resulting in incorrect URL conversions. Its output should be file://server/share/folder/file.txt.
What do you see instead?
file:///UNC/server/share/folder/file.txt
Additional information
No response
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.