Skip to content
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

net/url: file URL with Windows path not parsed correctly #11223

Closed
dgolub opened this issue Jun 15, 2015 · 1 comment
Closed

net/url: file URL with Windows path not parsed correctly #11223

dgolub opened this issue Jun 15, 2015 · 1 comment

Comments

@dgolub
Copy link

dgolub commented Jun 15, 2015

The Parse function in the net/url package does not properly handle a file URL with a Windows path. It should place the entire local path after the file:// in the Path field on the URL object, as on Unix/Linux, but it does not. If the path is specified entirely using backslashes, then it will be placed in the Host field. If it is specified using forward slashes or some combination of backslashes and forward slashes, then the portion before the first forward slash will be placed in the Host field and the remainder will be placed in the Path field. For example, the URL file://C:\Windows\System32\kernel32.dll parses to {Host: "C:\Windows\System32\kernel32.dll"} and the URL file://C:\Windows\System32/kernel32.dll parses to {Host: "C:\Windows\System32", Path: "/kernel32.dll"}. They should instead parse to {Path: "C:\Windows\System32\kernel32.dll"} and {Path: "C:\Windows\System32/kernel32.dll"}, respectively.

@bradfitz
Copy link
Contributor

Pretty sure this is a dup of #6027

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants