forked from mirror/client_golang
Merge pull request #652 from ahjdzx/fix_status_code
Fix check status code
This commit is contained in:
commit
3ddc3cfbe5
|
@ -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