From: Tim Düsterhus Date: Thu, 23 Jul 2020 11:59:01 +0000 (+0200) Subject: Fix possible response truncation in HTTPRequest on Windows X-Git-Tag: 5.3.0_Alpha_1~121 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6b2b156c94bf6673ab77c6b2e1dce375b7497926;p=GitHub%2FWoltLab%2FWCF.git Fix possible response truncation in HTTPRequest on Windows --- diff --git a/wcfsetup/install/files/lib/util/HTTPRequest.class.php b/wcfsetup/install/files/lib/util/HTTPRequest.class.php index 27c84c7a29..5fb4cabaf8 100644 --- a/wcfsetup/install/files/lib/util/HTTPRequest.class.php +++ b/wcfsetup/install/files/lib/util/HTTPRequest.class.php @@ -190,7 +190,10 @@ final class HTTPRequest { $request = new Request($this->options['method'], $this->url, $headers, $this->body); try { - $this->response = $client->send($request); + $this->response = $client->send($request, [ + // https://github.com/guzzle/guzzle/issues/2735 + 'sink' => fopen("php://temp", "w+"), + ]); } catch (TooManyRedirectsException $e) { throw new HTTPException( @@ -269,7 +272,7 @@ final class HTTPRequest { if ($this->replyBody === null) { $bodyLength = 0; while (!$this->response->getBody()->eof()) { - $toRead = 1024; + $toRead = 8192; if (isset($this->options['maxLength'])) { $toRead = min($toRead, $this->options['maxLength'] - $bodyLength); }