fix the gosec test and a make target for it

This commit is contained in:
James Strong 2022-06-15 13:19:30 -04:00
parent 902c9dbee8
commit f5d3ab4505
No known key found for this signature in database
GPG key ID: 11048BF1C893BC89
3 changed files with 13 additions and 5 deletions

View file

@ -327,8 +327,10 @@ func registerProfiler() {
mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
server := &http.Server{
Addr: fmt.Sprintf("127.0.0.1:%v", nginx.ProfilerPort),
Handler: mux,
Addr: fmt.Sprintf("127.0.0.1:%v", nginx.ProfilerPort),
//G112 (CWE-400): Potential Slowloris Attack
ReadHeaderTimeout: 10 * time.Second,
Handler: mux,
}
klog.Fatal(server.ListenAndServe())
}