Skip to content

Commit 3ddc3cf

Browse files
authored
Merge pull request #652 from ahjdzx/fix_status_code
Fix check status code
2 parents 9a37535 + 7c6a9d7 commit 3ddc3cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prometheus/push/push.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func (p *Pusher) push(method string) error {
267267
return err
268268
}
269269
defer resp.Body.Close()
270-
if resp.StatusCode != 202 {
270+
if resp.StatusCode != 200 && resp.StatusCode != 202 {
271271
body, _ := ioutil.ReadAll(resp.Body) // Ignore any further error as this is for an error message only.
272272
return fmt.Errorf("unexpected status code %d while pushing to %s: %s", resp.StatusCode, p.fullURL(), body)
273273
}

0 commit comments

Comments
 (0)