Skip to content

Commit

Permalink
chore(auth): Do not skip tracing/header printing on 5xx/4xx code
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanilves committed Feb 4, 2020
1 parent d6888d7 commit 666a8fb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/v1/registry/client/request/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ func perform(url, auth, mode string, trace bool) (resp *http.Response, err error
if err != nil {
return nil, err
}
if resp.StatusCode != 200 && resp.StatusCode != 404 {
return resp, errors.New("Bad response status: " + resp.Status + " >> " + url)
}

if trace {
fmt.Printf("%s|@URL: %s\n", rid, url)
Expand All @@ -70,6 +67,10 @@ func perform(url, auth, mode string, trace bool) (resp *http.Response, err error
fmt.Printf("%s|--- BODY END ---\n", rid)
}

if resp.StatusCode != 200 && resp.StatusCode != 404 {
return resp, errors.New("Bad response status: " + resp.Status + " >> " + url)
}

return resp, nil
}

Expand Down

0 comments on commit 666a8fb

Please sign in to comment.