From: Tim Düsterhus Date: Mon, 1 Feb 2021 10:37:09 +0000 (+0100) Subject: Stream HTTPRequest responses only of a maximum length is desired X-Git-Tag: 5.3.4~3^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1a6fd5ae04eb9b275d1ca4b3f328f5a57d060a2b;p=GitHub%2FWoltLab%2FWCF.git Stream HTTPRequest responses only of a maximum length is desired cURL is not supported for streaming responses. As we process the full response body for requests without a maximum length there is no benefit to streaming the response, because we lose cURL support. --- diff --git a/wcfsetup/install/files/lib/util/HTTPRequest.class.php b/wcfsetup/install/files/lib/util/HTTPRequest.class.php index 11aa2c611e..efcc294c20 100644 --- a/wcfsetup/install/files/lib/util/HTTPRequest.class.php +++ b/wcfsetup/install/files/lib/util/HTTPRequest.class.php @@ -173,8 +173,10 @@ final class HTTPRequest { 'track_redirects' => true, 'on_redirect' => $redirectHandler, ], - 'stream' => true, ]; + if (isset($this->options['maxLength'])) { + $options['stream'] = true; + } if (isset($this->options['auth'])) { $options['auth'] = [ $this->options['auth']['username'],