We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Just a documentation issue that - http.ServeMux (cleanPath) gets also rid of duplicate /-s. http.ServeMux already contains:
http.ServeMux
/
ServeMux also takes care of sanitizing the URL request path, redirecting any request containing . or .. elements to an equivalent .- and ..-free URL.
I'm not sure how to reword it nicely to include the case of empty path segments, hence I didn't make a CL. Here's shortest example:
package main import ("fmt"; "net/http") func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "%s", r.URL.Path) }) http.ListenAndServe(":8001", nil) }
/hello////world will redirect to /hello/world. From URI standpoint they are different and both valid (https://tools.ietf.org/html/rfc3986#section-3.3).
/hello////world
/hello/world
The text was updated successfully, but these errors were encountered:
Related: #11757
@rsc, I can try to document these but feel free to steal these two as I still consider you the ServeMux owner. I've never really worked on it.
Sorry, something went wrong.
Thanks. I'll take these two.
CL https://golang.org/cl/17955 mentions this issue.
aaa0bc1
No branches or pull requests
Just a documentation issue that -
http.ServeMux
(cleanPath) gets also rid of duplicate/
-s.http.ServeMux
already contains:I'm not sure how to reword it nicely to include the case of empty path segments, hence I didn't make a CL. Here's shortest example:
/hello////world
will redirect to/hello/world
. From URI standpoint they are different and both valid (https://tools.ietf.org/html/rfc3986#section-3.3).The text was updated successfully, but these errors were encountered: