-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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/http: NewRequest cannot handle %2F in path #5777
Labels
Milestone
Comments
as documented in revision bb293c428338 (issue #3659), you can modify req.URL.Opaque to achieve your goal. Status changed to Unfortunate. |
I've gone with: req, _ = http.NewRequest(verb, reqAddress, buf) path := strings.TrimPrefix(req.URL.Scheme, reqAddress) path = strings.Split(reqAddress, "?")[0] req.URL.Opaque = path Which is essentially re-parsing the path out. I feel that if URL.Parse is not to be updated, than http.Request should probably do something like this? This issue would present itself again without a workaround if there were a %2F in a redirect for example. |
I see more and more REST services that use %2F in path elements that correspond to variables, and therefore more and more reports like this one. I am reopening this for a possible fix in the Go 1.5 cycle. I have a fix in mind. |
mikioh
changed the title
net/http.NewRequest cannot handle %2F in path
net/http: NewRequest cannot handle %2F in path
Jun 19, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by rjohnson.id.au:
The text was updated successfully, but these errors were encountered: