mirror of
https://github.com/owncast/owncast.git
synced 2025-01-31 20:54:15 +03:00
Guard against invalid push server response as an addition check for #2855
This commit is contained in:
parent
d35264e884
commit
21c26a7aa5
1 changed files with 6 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue