diff options
author | Valery Piashchynski <[email protected]> | 2022-07-18 15:38:46 +0200 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2022-07-18 15:38:46 +0200 |
commit | 22784d994d360a3ed90e9cb49104d23414242ae8 (patch) | |
tree | dc830cc93ad3cce1e89eaedf9d85cb9f640853f9 | |
parent | dc7a4c54357ae5d99f5251bdc40d2bf0adc9e2d4 (diff) |
debug server: add readheadertimeout
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r-- | internal/debug/server.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/debug/server.go b/internal/debug/server.go index c07a4549..6a758055 100644 --- a/internal/debug/server.go +++ b/internal/debug/server.go @@ -4,6 +4,7 @@ import ( "context" "net/http" "net/http/pprof" + "time" ) // Server is a HTTP server for debugging. @@ -21,7 +22,10 @@ func NewServer() Server { mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) mux.HandleFunc("/debug/pprof/trace", pprof.Trace) - return Server{srv: &http.Server{Handler: mux}} + return Server{srv: &http.Server{ + ReadHeaderTimeout: time.Minute * 10, + Handler: mux, + }} } // Start debug server. |