MCPcopy
hub / github.com/valyala/fasthttp / BodyGunzipWithLimit

Method BodyGunzipWithLimit

http.go:520–522  ·  view source on GitHub ↗

BodyGunzipWithLimit returns un-gzipped body data and limits the size of uncompressed body data to maxBodySize bytes. If maxBodySize <= 0, then no limit is applied.

(maxBodySize int)

Source from the content-addressed store, hash-verified

518//
519// If maxBodySize <= 0, then no limit is applied.
520func (resp *Response) BodyGunzipWithLimit(maxBodySize int) ([]byte, error) {
521 return gunzipData(resp.Body(), maxBodySize)
522}
523
524func gunzipData(p []byte, maxBodySize int) ([]byte, error) {
525 var bb bytebufferpool.ByteBuffer

Callers 2

BodyGunzipMethod · 0.95

Calls 2

BodyMethod · 0.95
gunzipDataFunction · 0.85

Tested by

no test coverage detected