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

Clean path in serverMux should apply to raw path #4732

Closed
gopherbot opened this issue Jan 31, 2013 · 1 comment
Closed

Clean path in serverMux should apply to raw path #4732

gopherbot opened this issue Jan 31, 2013 · 1 comment
Milestone

Comments

@gopherbot
Copy link
Contributor

by hongruiqi:

What steps will reproduce the problem?
http.Handle("/test///a", Handler)
And visit http://localhost/test/%2f/a

What is the expected output?
Handler should be called.

What do you see instead?
The browser is redirected to /test/a, and a 404 error

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
linux

Which version are you using?  (run 'go version')
go version devel +0d9fd828f099 Wed Jan 30 17:26:22 2013 +1100 linux/amd64.

Please provide any additional information below.

if p := cleanPath(path); p != path {
    _, pattern = mux.handler(r.Host, p)
    return RedirectHandler(p, StatusMovedPermanently), pattern
}

If path is a raw path before unescape,/test/%2f/a can be handled correctly without
redirect. mux.match can use r.URL.Path as before.
@rsc
Copy link
Contributor

rsc commented Jan 31, 2013

Comment 1:

The HTTP server has no way to distinguish /test/%2f/a from /test///a. There is a pending
issue to document this property in net/url better. I am marking this issue a duplicate
of that one.

Status changed to Duplicate.

Merged into issue #3659.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

2 participants