mirror of
https://github.com/mailgun/groupcache.git
synced 2024-11-16 14:10:04 +00:00
Error size now limited to 1MiB
This commit is contained in:
parent
abdfdfbb8e
commit
df5395112d
2
http.go
2
http.go
@ -299,7 +299,7 @@ func (h *httpGetter) Get(ctx context.Context, in *pb.GetRequest, out *pb.GetResp
|
||||
}
|
||||
defer res.Body.Close()
|
||||
if res.StatusCode != http.StatusOK {
|
||||
msg, _ := ioutil.ReadAll(io.LimitReader(res.Body, 10*1024*1024)) // Limit reading the error body to max 10 MiB
|
||||
msg, _ := ioutil.ReadAll(io.LimitReader(res.Body, 1024*1024)) // Limit reading the error body to max 1 MiB
|
||||
return fmt.Errorf("server returned: %v, %v", res.Status, msg)
|
||||
}
|
||||
b := bufferPool.Get().(*bytes.Buffer)
|
||||
|
Loading…
Reference in New Issue
Block a user