Closed combinator closed 4 years ago
Create a client object . Submit request . If headers are empty, the script dies due to fatal error.
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/app_root/vendor/yiisoft/yii2-httpclient/src/Response.php on line 62 PHP Fatal Error 'yii\base\ErrorException' with message 'Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes)' in /var/www/app_root/vendor/yiisoft/yii2-httpclient/src/Response.php:62 Stack trace: #0 [internal function]: yii\base\ErrorHandler->handleFatalError() #1 {main}
Script should not generate any errors
RESPONSE
yii\httpclient\Response Object ( [client] => yii\httpclient\Client Object ( [baseUrl] => https://sandbox.xxxx.com [formatters] => Array ( [json] => yii\httpclient\JsonFormatter Object ( [encodeOptions] => 0 ) ) [parsers] => Array ( ) [requestConfig] => Array ( [format] => json ) [responseConfig] => Array ( [format] => json ) [contentLoggingMaxSize] => 2000 [_transport:yii\httpclient\Client:private] => yii\httpclient\CurlTransport Object ( [_events:yii\base\Component:private] => Array ( ) [_eventWildcards:yii\base\Component:private] => Array ( ) [_behaviors:yii\base\Component:private] => ) [_events:yii\base\Component:private] => Array ( ) [_eventWildcards:yii\base\Component:private] => Array ( ) [_behaviors:yii\base\Component:private] => Array ( ) ) [_headers:yii\httpclient\Message:private] => yii\web\HeaderCollection Object ( [_headers:yii\web\HeaderCollection:private] => Array ( [http-code] => Array ( [0] => 500 ) [content-length] => Array ( [0] => 0 ) [request-context] => Array ( [0] => appId=cid-v1:e996501c-e721-4ac1-97ff-dc6887b85e8c ) [date] => Array ( [0] => Tue, 11 Aug 2020 18:34:35 GMT ) ) ) [_cookies:yii\httpclient\Message:private] => [_content:yii\httpclient\Message:private] => [_data:yii\httpclient\Message:private] => [_format:yii\httpclient\Message:private] => json [_events:yii\base\Component:private] => Array ( ) [_eventWildcards:yii\base\Component:private] => Array ( ) [_behaviors:yii\base\Component:private] => )
the issue was related to an infinite loop in the code. Closing the issue
What steps will reproduce the problem?
Create a client object . Submit request . If headers are empty, the script dies due to fatal error.
What's expected?
Script should not generate any errors
What do you get instead?
RESPONSE
Additional info