File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,10 @@ import (
27
27
"github.com/ava-labs/avalanchego/utils/logging"
28
28
)
29
29
30
- const baseURL = "/ext"
30
+ const (
31
+ baseURL = "/ext"
32
+ readHeaderTimeout = 10 * time .Second
33
+ )
31
34
32
35
var (
33
36
errUnknownLockOption = errors .New ("invalid lock options" )
@@ -164,7 +167,10 @@ func (s *server) Dispatch() error {
164
167
s .log .Info ("HTTP API server listening on \" %s:%d\" " , s .listenHost , ipPort .Port )
165
168
}
166
169
167
- s .srv = & http.Server {Handler : s .handler }
170
+ s .srv = & http.Server {
171
+ Handler : s .handler ,
172
+ ReadHeaderTimeout : readHeaderTimeout ,
173
+ }
168
174
return s .srv .Serve (listener )
169
175
}
170
176
@@ -191,7 +197,11 @@ func (s *server) DispatchTLS(certBytes, keyBytes []byte) error {
191
197
s .log .Info ("HTTPS API server listening on \" %s:%d\" " , s .listenHost , ipPort .Port )
192
198
}
193
199
194
- s .srv = & http.Server {Addr : listenAddress , Handler : s .handler }
200
+ s .srv = & http.Server {
201
+ Addr : listenAddress ,
202
+ Handler : s .handler ,
203
+ ReadHeaderTimeout : readHeaderTimeout ,
204
+ }
195
205
return s .srv .Serve (listener )
196
206
}
197
207
Original file line number Diff line number Diff line change 24
24
TESTS=${TESTS:- " golangci_lint license_header" }
25
25
26
26
function test_golangci_lint {
27
- go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2
27
+ go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.1
28
28
golangci-lint run --config .golangci.yml
29
29
}
30
30
You can’t perform that action at this time.
0 commit comments