mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
webhooks: Use 200 status code for unknown events.
Because the third party might not be expecting a 400 from our
webhooks, we now instead use 200 status code for unknown events,
while sending back the error to Sentry. Because it is no longer an error
response, the response type should now be "success".
Fixes #24721.
(cherry picked from commit 84723654c8)
This commit is contained in:
committed by
Alex Vandiver
parent
61b5577cf4
commit
ec8a284ad5
@@ -370,6 +370,7 @@ class UnsupportedWebhookEventTypeError(WebhookError):
|
||||
"""
|
||||
|
||||
code = ErrorCode.UNSUPPORTED_WEBHOOK_EVENT_TYPE
|
||||
http_status_code = 200
|
||||
data_fields = ["webhook_name", "event_type"]
|
||||
|
||||
def __init__(self, event_type: Optional[str]) -> None:
|
||||
@@ -378,7 +379,9 @@ class UnsupportedWebhookEventTypeError(WebhookError):
|
||||
|
||||
@staticmethod
|
||||
def msg_format() -> str:
|
||||
return _("The '{event_type}' event isn't currently supported by the {webhook_name} webhook")
|
||||
return _(
|
||||
"The '{event_type}' event isn't currently supported by the {webhook_name} webhook; ignoring"
|
||||
)
|
||||
|
||||
|
||||
class AnomalousWebhookPayloadError(WebhookError):
|
||||
|
||||
Reference in New Issue
Block a user