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.
This commit is contained in:
committed by
Tim Abbott
parent
2e4f7f6336
commit
84723654c8
@@ -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