forked from mirror/client_golang
Fix check status code
Signed-off-by: Xin Zhang <ahjdzx1990@gmail.com>
This commit is contained in:
parent
9a37535b1b
commit
7c6a9d7568
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue