1
0
Fork 0

RemoteFileSystem: catch decode errors for content length mismatch

pull/9176/head
Stephan 2020-09-04 11:33:36 +01:00
parent 3b2d91975e
commit 32a0563443
1 changed files with 6 additions and 1 deletions

View File

@ -299,7 +299,12 @@ class RemoteFilesystem
$e = new TransportException('Content-Length mismatch, received '.Platform::strlen($result).' bytes out of the expected '.$contentLength);
$e->setHeaders($http_response_header);
$e->setStatusCode($this->findStatusCode($http_response_header));
try {
$e->setResponse($this->decodeResult($result, $http_response_header));
} catch (\Exception $e) {
$e->setResponse($result);
}
$this->io->writeError('Content-Length mismatch, received '.Platform::strlen($result).' out of '.$contentLength.' bytes: (' . base64_encode($result).')', true, IOInterface::DEBUG);
throw $e;