Set 'stream' to `true` for Guzzle in `HTTPRequest`
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 21 Jan 2021 08:33:22 +0000 (09:33 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 21 Jan 2021 08:33:22 +0000 (09:33 +0100)
This is required to properly support the 'maxLength' option on endless streams
(such as a web radio). Without setting 'stream' to `true`, Guzzle attempts to
download the entire response body before returning from `->send()`.

wcfsetup/install/files/lib/util/HTTPRequest.class.php

index 2867920d993bbdb7ed5ac41dfa21cc1093d28911..11aa2c611e85651829fca7e19f74db9e84d1b670 100644 (file)
@@ -173,6 +173,7 @@ final class HTTPRequest {
                                'track_redirects' => true,
                                'on_redirect' => $redirectHandler,
                        ],
+                       'stream' => true,
                ];
                if (isset($this->options['auth'])) {
                        $options['auth'] = [