Skip to content

Commit

Permalink
Merge pull request #652 from ahjdzx/fix_status_code
Browse files Browse the repository at this point in the history
Fix check status code
  • Loading branch information
beorn7 committed Oct 12, 2019
2 parents 9a37535 + 7c6a9d7 commit 3ddc3cf
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 3ddc3cf

Please sign in to comment.