]> git.mxchange.org Git - friendica.git/commitdiff
Make hard-coded max response configurable:
authorRoland Häder <roland@mxchange.org>
Tue, 16 Jan 2024 18:52:06 +0000 (19:52 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 17 Jan 2024 00:05:48 +0000 (01:05 +0100)
- see discussion started by @schmaker@schmaker.eu at https://schmaker.eu/display/c83e3896-1265-a3d6-0ab5-a78119129626
- this allows servers with lower RAM amount to still run without OOMs (or much lesser)

src/Network/HTTPClient/Factory/HttpClient.php

index 26ddde62c04dce405b5b1477ef7d53880fa95508..fca5d53130fbba005e3d2eeb0bdb0a8da620fb7a 100644 (file)
@@ -123,7 +123,7 @@ class HttpClient extends BaseFactory
                $resolver->setMaxRedirects(10);
                $resolver->setRequestTimeout(10);
                // if the file is too large then exit
-               $resolver->setMaxResponseDataSize(1000000);
+               $resolver->setMaxResponseDataSize($this->config->get('system', 'max_response_data_size', 1000000));
                // Designate a temporary file that will store cookies during the session.
                // Some websites test the browser for cookie support, so this enhances results.
                $resolver->setCookieJar(System::getTempPath() .'/resolver-cookie-' . Strings::getRandomName(10));