We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90be20d commit 09f6803Copy full SHA for 09f6803
1 file changed
service.go
@@ -1,4 +1,4 @@
1
-// Copyright (c) 2017-2025 The Decred developers
+// Copyright (c) 2017-2026 The Decred developers
2
// Use of this source code is governed by an ISC
3
// license that can be found in the LICENSE file.
4
@@ -190,7 +190,7 @@ func (service *Service) getHTTP(url string) ([]byte, error) {
190
url, poolResp.StatusCode)
191
}
192
193
- respBody, err := io.ReadAll(poolResp.Body)
+ respBody, err := io.ReadAll(io.LimitReader(poolResp.Body, 1<<20)) // 1 MiB limit
194
if err != nil {
195
return nil, fmt.Errorf("%v: failed to read body: %w", url, err)
196
0 commit comments