HttpServer: Make read timeout configurable but disabled by default (#31575)
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
This commit is contained in:
@@ -115,8 +115,9 @@ func (hs *HTTPServer) Run(ctx context.Context) error {
|
||||
// Remove any square brackets enclosing IPv6 addresses, a format we support for backwards compatibility
|
||||
host := strings.TrimSuffix(strings.TrimPrefix(hs.Cfg.HTTPAddr, "["), "]")
|
||||
hs.httpSrv = &http.Server{
|
||||
Addr: net.JoinHostPort(host, hs.Cfg.HTTPPort),
|
||||
Handler: hs.macaron,
|
||||
Addr: net.JoinHostPort(host, hs.Cfg.HTTPPort),
|
||||
Handler: hs.macaron,
|
||||
ReadTimeout: hs.Cfg.ReadTimeout,
|
||||
}
|
||||
switch hs.Cfg.Protocol {
|
||||
case setting.HTTP2Scheme:
|
||||
|
||||
Reference in New Issue
Block a user