mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #5083 from shin-/4343-http_401_private_push_error
Added specific error message when hitting 401 over HTTP on push
This commit is contained in:
commit
29fd62f396
1 changed files with 3 additions and 0 deletions
|
@ -417,6 +417,9 @@ func (r *Registry) PushImageJSONRegistry(imgData *ImgData, jsonRaw []byte, regis
|
|||
return fmt.Errorf("Failed to upload metadata: %s", err)
|
||||
}
|
||||
defer res.Body.Close()
|
||||
if res.StatusCode == 401 && strings.HasPrefix(registry, "http://") {
|
||||
return utils.NewHTTPRequestError("HTTP code 401, Docker will not send auth headers over HTTP.", res)
|
||||
}
|
||||
if res.StatusCode != 200 {
|
||||
errBody, err := ioutil.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue