Browse Source

Guard against invalid push server response as an addition check for #2855

pull/2860/head
Gabe Kangas 2 years ago
parent
commit
21c26a7aa5
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
  1. 7
      notifications/browser/browser.go

7
notifications/browser/browser.go

@ -76,10 +76,15 @@ func (b *Browser) Send( @@ -76,10 +76,15 @@ func (b *Browser) Send(
return false, errors.Wrap(err, "error sending browser push notification")
}
if resp == nil {
return false, errors.New("no response from web push server")
}
defer resp.Body.Close()
if resp.StatusCode == 410 {
return true, nil
}
defer resp.Body.Close()
return false, err
}

Loading…
Cancel
Save