Skip to content

Commit 7c6a9d7

Browse files
committed
Fix check status code
Signed-off-by: Xin Zhang <[email protected]>
1 parent 9a37535 commit 7c6a9d7

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)