]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: clarify ServeMux path sanitization
authorSean Liao <sean@liao.dev>
Thu, 31 Oct 2024 00:21:38 +0000 (00:21 +0000)
committerDamien Neil <dneil@google.com>
Thu, 31 Oct 2024 19:30:39 +0000 (19:30 +0000)
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>
src/net/http/server.go

index bd16eeb08e64350dda9a7b7e84d8a0edb3f03df9..db44e7c5c241fe3eecb27d7181efa9bd0ca64a59 100644 (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
 //