net/http: ServeMux should not cleanup requests path and redirect by default #19481
Labels
Comments
Sorry, it's too late to change this, regardless of whether it's a good idea or not. It's also a documented feature:
There are hundreds of alternative muxes available. See https://godoc.org/ to find some. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.7.3 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
What did you do?
http.ServerMux
always forces a redirect to cleaned up path (e.g..
and..
removed, empty path components removed, etc..). Specifically, removing an empty component can change the meaning of the URI. In a general case, the handlers should be able to see raw requested URI and decide how the want to handle it. FileSystem handler may want to cleanup paths in this way, but for other cases this is unexpected behavior.What did you expect to see?
Request for /foo//bar gets redirected to /foo/bar.
What did you see instead?
Request for /foo//bar gets dispatched to the proper handler that matches this URI without cleanup.
The text was updated successfully, but these errors were encountered: