mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
server: set ReadHeaderTimeout to 32s on all HTTP servers
Signed-off-by: RinZ27 <222222878+RinZ27@users.noreply.github.com>
This commit is contained in:
+11
-6
@@ -659,8 +659,9 @@ func (s *Server) getListener(addr string, h http.Handler, t httpListenerType) ([
|
||||
|
||||
func (s *Server) getListenerForHTTPServer(u *url.URL, h http.Handler, t httpListenerType) (Loop, httpListener, error) {
|
||||
h1s := http.Server{
|
||||
Addr: u.Host,
|
||||
Handler: h,
|
||||
Addr: u.Host,
|
||||
Handler: h,
|
||||
ReadHeaderTimeout: 32 * time.Second,
|
||||
}
|
||||
if s.h2cEnabled {
|
||||
p := new(http.Protocols)
|
||||
@@ -712,9 +713,10 @@ func (s *Server) getListenerForHTTPSServer(u *url.URL, h http.Handler, t httpLis
|
||||
}
|
||||
|
||||
httpsServer := http.Server{
|
||||
Addr: u.Host,
|
||||
Handler: h,
|
||||
TLSConfig: &tlsConfig,
|
||||
Addr: u.Host,
|
||||
Handler: h,
|
||||
TLSConfig: &tlsConfig,
|
||||
ReadHeaderTimeout: 32 * time.Second,
|
||||
}
|
||||
|
||||
l := newHTTPListener(&httpsServer, t)
|
||||
@@ -739,7 +741,10 @@ func (s *Server) getListenerForUNIXSocket(u *url.URL, h http.Handler, t httpList
|
||||
os.Remove(socketPath)
|
||||
}
|
||||
|
||||
domainSocketServer := http.Server{Handler: h}
|
||||
domainSocketServer := http.Server{
|
||||
Handler: h,
|
||||
ReadHeaderTimeout: 32 * time.Second,
|
||||
}
|
||||
if s.h2cEnabled {
|
||||
p := new(http.Protocols)
|
||||
p.SetHTTP1(true)
|
||||
|
||||
Reference in New Issue
Block a user