1
0
Fork 0
mirror of https://github.com/owncast/owncast.git synced 2024-10-28 01:59:38 +01:00

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

This commit is contained in:
Gabe Kangas 2023-03-21 17:26:06 -07:00
parent d35264e884
commit 21c26a7aa5
No known key found for this signature in database
GPG key ID: 4345B2060657F330

View file

@ -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
}