From 1a6fd5ae04eb9b275d1ca4b3f328f5a57d060a2b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 1 Feb 2021 11:37:09 +0100 Subject: [PATCH] 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. --- wcfsetup/install/files/lib/util/HTTPRequest.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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'], -- 2.20.1