From 74e30f06d2470920b2d1244afe9b4c5ea43188a5 Mon Sep 17 00:00:00 2001 From: Vyr Cossont Date: Sun, 1 Dec 2024 21:25:55 -0800 Subject: [PATCH] Accept any 2xx code as a success --- internal/webpush/realsender.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/webpush/realsender.go b/internal/webpush/realsender.go index b08add67a..8fe2dfda0 100644 --- a/internal/webpush/realsender.go +++ b/internal/webpush/realsender.go @@ -240,7 +240,7 @@ func (r *realSender) sendToSubscription( }() // If there's an error, log the response. - if resp.StatusCode != http.StatusOK { + if resp.StatusCode < 200 || resp.StatusCode > 299 { bodyBytes, err := io.ReadAll(io.LimitReader(resp.Body, responseBodyMaxLen)) if err != nil { return gtserror.Newf("error reading Web Push server response: %w", err)