diff --git a/contrib/fuzz/daemon.go b/contrib/fuzz/daemon.go index 309ec65ba..a06bc561f 100644 --- a/contrib/fuzz/daemon.go +++ b/contrib/fuzz/daemon.go @@ -3,10 +3,13 @@ /* Copyright The containerd Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/pkg/cri/streaming/server.go b/pkg/cri/streaming/server.go index 346dfb2c7..cc598562c 100644 --- a/pkg/cri/streaming/server.go +++ b/pkg/cri/streaming/server.go @@ -162,10 +162,11 @@ func NewServer(config Config, runtime Runtime) (Server, error) { handler.Add(ws) s.handler = handler s.server = &http.Server{ - Addr: s.config.Addr, - Handler: s.handler, - TLSConfig: s.config.TLSConfig, - ReadHeaderTimeout: 3 * time.Second, // Fix linter G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server + Addr: s.config.Addr, + Handler: s.handler, + TLSConfig: s.config.TLSConfig, + // TODO(fuweid): allow user to configure streaming server + ReadHeaderTimeout: 30 * time.Minute, // Fix linter G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server } return s, nil