mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-13 23:41:16 +00:00
fix(server): set ReadHeaderTimeout on HTTP servers (#38878)
Add `ReadHeaderTimeout` which limits how long a client can take to send HTTP headers.
This commit is contained in:
+2
-1
@@ -244,7 +244,8 @@ func servePprof() {
|
||||
_, _, finished := process.GetManager().AddTypedContext(context.TODO(), "Web: PProf Server", process.SystemProcessType, true)
|
||||
// The pprof server is for debug purpose only, it shouldn't be exposed on public network. At the moment, it's not worth introducing a configurable option for it.
|
||||
log.Info("Starting pprof server on localhost:6060")
|
||||
log.Info("Stopped pprof server: %v", http.ListenAndServe("localhost:6060", mux))
|
||||
server := &http.Server{Addr: "localhost:6060", Handler: mux, ReadHeaderTimeout: 10 * time.Second}
|
||||
log.Info("Stopped pprof server: %v", server.ListenAndServe())
|
||||
finished()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user