Skip to content

Commit 1c74198

Browse files
Error on unknown content size:
Signed-off-by: Jacob Weinstock <[email protected]>
1 parent 105162f commit 1c74198

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

providers/rpc/rpc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ func (p *Provider) process(ctx context.Context, rp RequestPayload) (ResponsePayl
327327
defer resp.Body.Close()
328328

329329
// handle the response
330-
if resp.ContentLength > maxContentLenAllowed {
330+
if resp.ContentLength > maxContentLenAllowed || resp.ContentLength < 0 {
331331
return ResponsePayload{}, fmt.Errorf("response body is too large: %d bytes, max allowed: %d bytes", resp.ContentLength, maxContentLenAllowed)
332332
}
333333
respPayload, err := p.handleResponse(resp, kvs)

0 commit comments

Comments
 (0)