chg: [sync] Do not decode body if is empty

pull/7155/head
Jakub Onderka 2021-01-13 23:15:04 +01:00
parent 6f74097c37
commit 27e58bbb2d
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ class HttpSocketResponseExtended extends HttpSocketResponse
{
parent::parseResponse($message);
if ($this->body === '') {
return; // skip decoding body if is empty
}
$contentEncoding = $this->getHeader('Content-Encoding');
if ($contentEncoding === 'gzip' && function_exists('gzdecode')) {
$this->body = gzdecode($this->body);