spatie / laravel-webhook-client

Receive webhooks in Laravel apps
https://freek.dev/1383-sending-and-receiving-webhooks-in-laravel-apps
MIT License
985 stars 146 forks source link

Change error http response code #190

Closed waltherjochen closed 1 year ago

waltherjochen commented 1 year ago

If $computedSignature does not match the value in the signature header, the package will respond with a 500 and discard the request.

Hi, currently you can only change the valid response code. respondToValidWebhook. Is it also possible to change the error response code 500 server error? e.g. Mailgun expects a 406 response code, if there is an issue.

image

https://documentation.mailgun.com/en/latest/user_manual.html#webhooks-1

Otherwise mailgun will just send the webhook again.

Thank you.

freekmurze commented 1 year ago

I'm thinking that if Mailgun sends a webhook, and the signature is wrong, that it is more likely that you did something wrong in your setup, and you want Mailgun to send the webhook again when you correct it.