fix: accept all 2xx status codes
This commit is contained in:
parent
34db837a9e
commit
85c852f4bb
1 changed files with 2 additions and 2 deletions
4
api.go
4
api.go
|
|
@ -86,7 +86,7 @@ func (s *Scraper) handleResponse(resp *http.Response, target interface{}) error
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusNoContent {
|
if resp.StatusCode >= 300 {
|
||||||
return fmt.Errorf("response status %s: %s", resp.Status, content)
|
return fmt.Errorf("response status %s: %s", resp.Status, content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -119,7 +119,7 @@ func (s *Scraper) GetGuestToken() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusNoContent {
|
if resp.StatusCode >= 300 {
|
||||||
return fmt.Errorf("response status %s: %s", resp.Status, body)
|
return fmt.Errorf("response status %s: %s", resp.Status, body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue