Merge pull request #652 from ahjdzx/fix_status_code

Fix check status code
This commit is contained in:
Björn Rabenstein 2019-10-12 14:49:42 +02:00 committed by GitHub
commit 3ddc3cfbe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}