Commit 1f2f5ec
authored
Treat webhook 422 responses as proper failures (#6426)
HookRelay returns 422 when it rejects a webhook delivery request, for
example when its SSRF protection blocks the target URL. Previously, the
`discard_on` handler only called `increment! :failure_count`, which
doesn't contribute to the disable threshold. This meant webhooks with
blocked URLs would accumulate failures indefinitely without ever being
disabled.
Call `failure!` instead of `increment! :failure_count` in the
`discard_on` handler. `failure!` tracks `failures_since_last_success`,
which will automatically disable the webhook after exceeding the
failure threshold.
422s were previously given special treatment under the assumption they
might not represent a real delivery failure. But there's no scenario
where a 422 from HookRelay should not count as a failure -- the request
was understood and rejected.1 parent a60f315 commit 1f2f5ec
2 files changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
88 | 117 | | |
89 | 118 | | |
0 commit comments