Refactor handling of HTTP response data
- Added condition to check status code for response body - Updated logic for determining presence of response
This commit is contained in:
parent
069e550a3f
commit
e004a1002e
@ -44,6 +44,8 @@ if(php_sapi_name() == 'cli' || $_SERVER["REQUEST_URI"] == '/metrics') {
|
||||
|
||||
if (isset($submetric['http']['data']) && $submetric['http']['data'] == 'responsebody') {
|
||||
$output = $res->getBody()->getContents();
|
||||
} elseif ((isset($submetric['http']['statuscode'])) && (isset($submetric['http']['data']) && $submetric['http']['data'] == 'hasresponse')) {
|
||||
$output = (int)in_array($res->getStatusCode(), $submetric['http']['statuscode']);
|
||||
} elseif (isset($submetric['http']['data']) && $submetric['http']['data'] == 'hasresponse') {
|
||||
$output = (int)$hasresponse;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user