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: Parsing of absolute Windows filepaths without scheme #13276

Closed
JaCoB1123 opened this issue Nov 16, 2015 · 1 comment
Closed

net/url: Parsing of absolute Windows filepaths without scheme #13276

JaCoB1123 opened this issue Nov 16, 2015 · 1 comment

Comments

@JaCoB1123
Copy link

Parsing a Windows filepath without scheme yields an invalid url:
Examples: https://play.golang.org/p/QuBFiU_1b1

# Working when prefixed with file:///
file:///c:\foo\bar
Scheme: file
Host: 
Path: /c:\foo\bar

file:///c:/foo/bar
Scheme: file
Host: 
Path: /c:/foo/bar

# Not working with only 2 leading slashes
file://c:\foo\bar
Scheme: file
Host: c:\foo\bar
Path: 

# Host containing colon but without port should not be valid?
file://c:/foo/bar
Scheme: file
Host: c:
Path: /foo/bar

# Expected: Scheme: empty, Path: input
c:\foo\bar
Scheme: c
Host: 
Path: 

# Expected: Scheme: empty, Path: input
c:/foo/bar
Scheme: c
Host: 
Path: /foo/bar

The middle two tests aren't real bugs though, I guess.

@bradfitz
Copy link
Contributor

The net/url package parses URLs, not file paths. Windows has nothing to do with this.

Working as intended.

@golang golang locked and limited conversation to collaborators Nov 16, 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