Skip to content

Commit

Permalink
Error size now limited to 1MiB
Browse files Browse the repository at this point in the history
  • Loading branch information
thrawn01 committed Jul 28, 2022
1 parent abdfdfb commit df53951
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit df53951

Please sign in to comment.