Accept any 2xx code as a success

This commit is contained in:
Vyr Cossont 2024-12-01 21:25:55 -08:00
parent a356c860dd
commit 74e30f06d2

View file

@ -240,7 +240,7 @@ func (r *realSender) sendToSubscription(
}() }()
// If there's an error, log the response. // 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)) bodyBytes, err := io.ReadAll(io.LimitReader(resp.Body, responseBodyMaxLen))
if err != nil { if err != nil {
return gtserror.Newf("error reading Web Push server response: %w", err) return gtserror.Newf("error reading Web Push server response: %w", err)