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

Comments

Projects
None yet
4 participants
@DanielMorsing
Contributor

DanielMorsing commented Apr 13, 2015

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

This comment has been minimized.

Show comment
Hide comment
@rsc

rsc Dec 4, 2015

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot commented Dec 4, 2015

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

@rsc rsc closed this 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.