]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document Redirect behavior for non-ASCII characters
authorIan Lance Taylor <iant@golang.org>
Sun, 9 Mar 2025 02:32:14 +0000 (18:32 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 11 Mar 2025 22:08:56 +0000 (15:08 -0700)
For #4385
For #72745

Change-Id: Ibd54fc03467eb948001299001bb2e2529512a7c0
Reviewed-on: https://go-review.googlesource.com/c/go/+/656135
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
src/net/http/server.go

index 2daf9d38e3a9131cff3c01601cb6e2aca1c51188..be25e9a450be66c0350651c542b062c3bd0da619 100644 (file)
@@ -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].