From fba23d3303e216bd8badf9cd0d143732e6b31b49 Mon Sep 17 00:00:00 2001 From: "e.martyn" Date: Thu, 13 Jun 2024 10:41:57 +0300 Subject: [PATCH] [api] pprof: remove loopback validation --- cmd/statshouse-api/statshouse-api.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cmd/statshouse-api/statshouse-api.go b/cmd/statshouse-api/statshouse-api.go index 51807b241..f4dfd6e28 100644 --- a/cmd/statshouse-api/statshouse-api.go +++ b/cmd/statshouse-api/statshouse-api.go @@ -13,7 +13,6 @@ import ( "fmt" "log" "math" - "net" "net/http" _ "net/http/pprof" // pprof HTTP handlers "os" @@ -483,12 +482,7 @@ func run(argv args, cfg *api.Config, vkuthPublicKeys map[string][]byte) error { go func() { // serve pprof on RPC port m := http.NewServeMux() m.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - remoteAddr, err := net.ResolveTCPAddr("tcp", r.RemoteAddr) - if err == nil && remoteAddr.IP.IsLoopback() { - http.DefaultServeMux.ServeHTTP(w, r) - } else { - w.WriteHeader(http.StatusUnauthorized) - } + http.DefaultServeMux.ServeHTTP(w, r) }) log.Printf("serving Go pprof at %q", argv.listenRPCAddr) s := http.Server{Handler: m}