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: URL.String can return invalid string if given invalid URL.Path #5927
Labels
Milestone
Comments
Seems like String() is ignoring the lack of a slash when it writes the path to the output. In your provided case, if you add the leading slash when setting u.Path it works fine. I've attached a proposed fix for the issue in url.go, as well as a source file that shows which cases work and which do not. I can push up a CL if there's interest. Attachments:
|
CL submitted as https://golang.org/cl/11698045/ |
I would consider this a bug solely based on this Go Playground example: http://play.golang.org/p/XWK4tgBqYo I would consider parsing the String() version of a *URL to turn back into an identical representation of the URL that made the string. However, due to this bug, it turns into a completely different (and wrong) URL object. |
This issue was closed by revision 39679ca. Status changed to Fixed. |
cbednarski
added a commit
to hashicorp/packer
that referenced
this issue
Jul 31, 2015
- Found while grepping for code.google.com - This was fixed here golang/go#5927 Pretty sure we don't support whatever version of go that was written for anymore.
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: