Hi,I would like to report a possible bug in Community Builder.In this file:
Code:
/libraries/CBLib/CBLib/AhaWow/View/RegistryEditView.php
around line
8107, the following code is used:
Code:
try {
$result = $client->get( $url );
// TODO: Implement handling of <data and sending as post instead of get when present
if ( $result->getStatusCode() != 200 ) {
$result = false;
}
} catch ( Exception $e ) {
$result = false;
}
The problem is that if the target URL is unavailable, slow, or does not respond properly for any reason, the request may hang and eventually cause a
504 Gateway Timeout error.I think it would be safer to define timeout options and also disable HTTP exceptions, for example:
Code:
try {
$result = $client->get( $url,
[
'http_errors' => false,
'connect_timeout' => 5,
'timeout' => 10,
]
);
// TODO: Implement handling of <data and sending as post instead of get when present
if ( $result->getStatusCode() != 200 ) {
$result = false;
}
} catch ( Exception $e ) {
$result = false;
}
This prevents the page from waiting too long when the remote URL is not reachable and avoids triggering a 504 error.Could you please check this and consider adding timeout handling in this request?Thank you.