Merge pull request #7286 from fuweid/follow-up-7254
Follow up #7254 (Switch to Go 1.19)
This commit is contained in:
		| @@ -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. | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Estes
					Phil Estes