diff --git a/src/Network/HTTPClient/Factory/HttpClient.php b/src/Network/HTTPClient/Factory/HttpClient.php index 26ddde62c0..e0de17c75a 100644 --- a/src/Network/HTTPClient/Factory/HttpClient.php +++ b/src/Network/HTTPClient/Factory/HttpClient.php @@ -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('performance', '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)); diff --git a/static/defaults.config.php b/static/defaults.config.php index 819b0ad85f..7439c7fdf6 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -614,6 +614,12 @@ return [ // Timeout in seconds for fetching the XRD links and other requests with an expected shorter timeout 'xrd_timeout' => 20, ], + 'performance' => [ + // max_response_data_size (Integer) + // Maximum allowed outgoing HTTP request response data size in Bytes. Does not affect incoming requests to this node. + // Warning: Lowering this value can help with some PHP memory exhaustion issues, but can also partially break some federation features e.g. large posts may not be fetched or received from remote servers. + 'max_response_data_size' => 1000000, + ], 'proxy' => [ // forwarded_for_headers (String) // A comma separated list of all allowed header values to retrieve the real client IP