tsweb: update ServeMux matching to 1.22.0 syntax (#11087)

Updates #cleanup

Go 1.22.0 introduced the ability to use more expressive routing patterns
that include HTTP method when constructing ServeMux entries.
Applications that attempted to use these patterns in combination with
the old `tsweb.Debugger` would experience a panic as Go would not permit
the use of matching rules with mixed level of specificity.

Signed-off-by: Patrick O'Doherty <patrick@tailscale.com>
This commit is contained in:
Patrick O'Doherty 2024-02-09 11:27:05 -08:00 committed by GitHub
parent c446451bfa
commit 291f91d164
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ func Debugger(mux *http.ServeMux) *DebugHandler {
ret := &DebugHandler{
mux: mux,
}
mux.Handle("/debug/", ret)
mux.Handle("GET /debug/", ret)
ret.KVFunc("Uptime", func() any { return varz.Uptime() })
ret.KV("Version", version.Long())