Skip to content

Commit e0bfb0a

Browse files
committed
fix: guard local named snapshot methods
1 parent 1fef414 commit e0bfb0a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

internal/ops/pprofmux.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ func registerLocalNamedSnapshotEndpoint(mux *http.ServeMux, pattern string, pref
102102
return mux
103103
}
104104
mux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {
105+
if r.Method != http.MethodGet {
106+
w.WriteHeader(http.StatusMethodNotAllowed)
107+
return
108+
}
105109
if !isLoopbackRemoteAddr(r.RemoteAddr) {
106110
w.WriteHeader(http.StatusForbidden)
107111
return

0 commit comments

Comments
 (0)