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: no way to construct raw unqualified request URI starting with // #10433

Closed
DanielMorsing opened this issue Apr 13, 2015 · 2 comments
Closed
Milestone

Comments

@DanielMorsing
Copy link
Contributor

http://play.golang.org/p/67oKm8TFcm

When I pass the URL in the playground into the http transport, it will call .RequestURI() and do a GET http://foo/bar%2f, while what I actually wanted was GET //foo/bar%2f. It looks like there is no possible way to construct a URL that will query for //foo/bar%2f.

Not quite sure how to distinguish between the case of Opaque containing a qualified URI and an unqualified one starting with //. Does it make sense to look at the host part after the // and see if it matches what's in Host?

@rsc
Copy link
Contributor

rsc commented Dec 4, 2015

This was fixed in Go 1.5: there is now a way to construct this request URI. Don't use Opaque, use RawPath (or just ParseRequestURI). I will add some tests to make sure this keeps working.

http://play.golang.org/p/De3q6SYhE9

@gopherbot
Copy link

CL https://golang.org/cl/17386 mentions this issue.

@rsc rsc closed this as completed in 503cbce Dec 10, 2015
@golang golang locked and limited conversation to collaborators Dec 14, 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

4 participants