Skip to content

Commit

Permalink
Fix check status code
Browse files Browse the repository at this point in the history
Signed-off-by: Xin Zhang <ahjdzx1990@gmail.com>
  • Loading branch information
ahjdzx committed Oct 12, 2019
1 parent 9a37535 commit 888e5fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prometheus/push/push.go
Expand Up @@ -267,7 +267,7 @@ func (p *Pusher) push(method string) error {
return err
}
defer resp.Body.Close()
if resp.StatusCode != 202 {
if resp.StatusCode != 200 || resp.StatusCode != 202 {
body, _ := ioutil.ReadAll(resp.Body) // Ignore any further error as this is for an error message only.
return fmt.Errorf("unexpected status code %d while pushing to %s: %s", resp.StatusCode, p.fullURL(), body)
}
Expand Down

0 comments on commit 888e5fe

Please sign in to comment.