From 817218a26c39911176c0d67258c637459f8d2fca Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 8 Mar 2025 18:32:14 -0800 Subject: [PATCH] net/http: document Redirect behavior for non-ASCII characters For #4385 For #72745 Change-Id: Ibd54fc03467eb948001299001bb2e2529512a7c0 Reviewed-on: https://go-review.googlesource.com/c/go/+/656135 LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Reviewed-by: Damien Neil --- src/net/http/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/net/http/server.go b/src/net/http/server.go index 2daf9d38e3..be25e9a450 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -2362,6 +2362,8 @@ func StripPrefix(prefix string, h Handler) Handler { // Redirect replies to the request with a redirect to url, // which may be a path relative to the request path. +// Any non-ASCII characters in url will be percent-encoded, +// but existing percent encodings will not be changed. // // The provided code should be in the 3xx range and is usually // [StatusMovedPermanently], [StatusFound] or [StatusSeeOther]. -- 2.51.0