Skip to content

Firefly III: a personal finances manager

Make sure rules are consistent and catch more errors.

James Cole6d4e45b89f55
diff --git a/app/Api/V1/Requests/Models/Webhook/UpdateRequest.php b/app/Api/V1/Requests/Models/Webhook/UpdateRequest.php
index 0cff3d42c4..157c2f5716 100644
--- a/app/Api/V1/Requests/Models/Webhook/UpdateRequest.php
+++ b/app/Api/V1/Requests/Models/Webhook/UpdateRequest.php
@@ -94,7 +94,7 @@ class UpdateRequest extends FormRequest
'trigger' => sprintf('in:%s', $triggers),
'response' => sprintf('in:%s', $responses),
'delivery' => sprintf('in:%s', $deliveries),
- 'url' => ['url', 'starts_with:https://', sprintf('uniqueExistingWebhook:%d', $webhook->id)],
+ 'url' => ['url', sprintf('uniqueExistingWebhook:%d', $webhook->id)],
];
}
}
diff --git a/app/Services/Webhook/StandardWebhookSender.php b/app/Services/Webhook/StandardWebhookSender.php
index ba99c844d8..5711b1e2cf 100644
--- a/app/Services/Webhook/StandardWebhookSender.php
+++ b/app/Services/Webhook/StandardWebhookSender.php
@@ -28,6 +28,7 @@ use FireflyIII\Helpers\Webhook\SignatureGeneratorInterface;
use FireflyIII\Models\WebhookAttempt;
use FireflyIII\Models\WebhookMessage;
use GuzzleHttp\Client;
+use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use JsonException;
use Log;
@@ -109,7 +110,7 @@ class StandardWebhookSender implements WebhookSenderInterface
$client = new Client();
try {
$res = $client->request('POST', $this->message->webhook->url, $options);
- } catch (RequestException $e) {
+ } catch (RequestException|ConnectException $e) {
Log::error($e->getMessage());
Log::error($e->getTraceAsString());