1
0
mirror of https://github.com/golang/go synced 2024-11-15 04:30:32 -07:00

net/http: clarify ServeMux path sanitization

For #70130

Change-Id: Idd7ca3d11b78887709b83dd5c868de9cc506ecff
Reviewed-on: https://go-review.googlesource.com/c/go/+/623835
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
Sean Liao 2024-10-31 00:21:38 +00:00 committed by Damien Neil
parent f7a14ae0cd
commit d6df73ce40

View File

@ -2480,6 +2480,8 @@ func RedirectHandler(url string, code int) Handler {
// ServeMux also takes care of sanitizing the URL request path and the Host
// header, stripping the port number and redirecting any request containing . or
// .. segments or repeated slashes to an equivalent, cleaner URL.
// Escaped path elements such as "%2e" for "." and "%2f" for "/" are preserved
// and aren't considered separators for request routing.
//
// # Compatibility
//