]> Cypherpunks repositories - gostls13.git/commit
net/http: skip redirecting in ServeMux when URL path for CONNECT is empty
authorNicholas Husin <husin@google.com>
Fri, 29 Aug 2025 14:34:10 +0000 (10:34 -0400)
committerGopher Robot <gobot@golang.org>
Sun, 31 Aug 2025 12:18:41 +0000 (05:18 -0700)
commit6a08e80399bd65b95e60e3c74b7e1f86754752a7
tree602f51e04b262aac490badcb0d84b5a46b32f724
parent8bcda6c79d40f49363cd04cdaf5bd7909de8f94f
net/http: skip redirecting in ServeMux when URL path for CONNECT is empty

In 1.21 ServeMux, we had a special-case to skip redirection when a given
path is empty for CONNECT requests:
https://go.googlesource.com/go/+/refs/tags/go1.24.4/src/net/http/servemux121.go#205.

This special case seems to not have been carried over to 1.22 ServeMux.
This causes needless redirection, which this CL fixes.

Fixes #74422

Change-Id: I3cc5b4d195ab0591a9139225b632cbe17f4290db
Reviewed-on: https://go-review.googlesource.com/c/go/+/699915
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Damien Neil <dneil@google.com>
src/net/http/server.go
src/net/http/server_test.go