Adding support for misconfigured gzip header from server

dev
Mzack9999 2021-06-17 14:36:25 +02:00
parent fbe75de23f
commit ba01a1c4ed
1 changed files with 5 additions and 1 deletions

View File

@ -362,7 +362,11 @@ func (r *Request) executeRequest(reqURL string, request *generatedRequest, previ
// encoding has been specified by the user in the request so in case we have to
// manually do it.
dataOrig := data
data, _ = handleDecompression(resp, data)
data, err = handleDecompression(resp, data)
// in case of error use original data
if err != nil {
data = dataOrig
}
// Dump response - step 2 - replace gzip body with deflated one or with itself (NOP operation)
dumpedResponseBuilder := &bytes.Buffer{}