aboutsummaryrefslogtreecommitdiff
path: root/src/path/filepath/path.go
diff options
context:
space:
mode:
authorMatteo Vaccari <matteo.vaccari@gmail.com>2024-02-22 16:11:20 +0000
committerJonathan Amsterdam <jba@google.com>2024-02-26 15:31:33 +0000
commit5225da7001e95d70771c054c40a4877911ab9f2b (patch)
tree98efb0012ee80042e8822aa7ca69395c0e2ddbb1 /src/path/filepath/path.go
parent7a64b0f07bf3576524fae2d395a31787386f2e40 (diff)
downloadgo-5225da7001e95d70771c054c40a4877911ab9f2b.tar.xz
expvar: avoid conflict with user-defined "GET /" route.
With the new routing style in go 1.22, declaring http.Handle("GET /", h) generates a conflict with route "/debug/vars" declared in the expvar package. You get an error such as: panic: pattern "GET /" (registered at ...) conflicts with pattern "/debug/vars" (registered at ...expvar.go:384): GET / matches fewer methods than /debug/vars, but has a more general path pattern This patch prevents that error. Adding GET is correct because no other method makes sense with /debug/vars. We preserve the traditional behaviour when GODEBUG=httpmuxgo121=1 is specified. Fixes #65723 Change-Id: Id2b963ebad41a1ebdcceb73baf3436d59aac73a0 GitHub-Last-Rev: 9c2b9f74a7c8a3c756e9948814231b8f4e60b216 GitHub-Pull-Request: golang/go#65745 Reviewed-on: https://go-review.googlesource.com/c/go/+/564735 Reviewed-by: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'src/path/filepath/path.go')
0 files changed, 0 insertions, 0 deletions