// Run with: GOTOOLCHAIN=go1.24.0 go run static/research/experiments/servemux_paths.go // This fixture records a redirect boundary. It contains no authorization logic. package main import ( "fmt" "net/http" "net/http/httptest" ) func main() { mux := http.NewServeMux() hits := 0 mux.HandleFunc("/private/report", func(w http.ResponseWriter, r *http.Request) { hits++ fmt.Fprint(w, "report") }) for _, path := range []string{ "/private/report", "/private/../private/report", "/private//report", } { w := httptest.NewRecorder() mux.ServeHTTP(w, httptest.NewRequest(http.MethodGet, path, nil)) fmt.Printf("path=%s status=%d location=%q handler_hits=%d\n", path, w.Code, w.Header().Get("Location"), hits) } }