Merge pull request #7286 from fuweid/follow-up-7254

Follow up #7254 (Switch to Go 1.19)
This commit is contained in:
Phil Estes 2022-08-18 10:35:43 -04:00 committed by GitHub
commit 49a945b26b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -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.

View File

@ -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