Skip to content

Commit 666a8fb

Browse files
committed
chore(auth): Do not skip tracing/header printing on 5xx/4xx code
1 parent d6888d7 commit 666a8fb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

api/v1/registry/client/request/request.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ func perform(url, auth, mode string, trace bool) (resp *http.Response, err error
5454
if err != nil {
5555
return nil, err
5656
}
57-
if resp.StatusCode != 200 && resp.StatusCode != 404 {
58-
return resp, errors.New("Bad response status: " + resp.Status + " >> " + url)
59-
}
6057

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

70+
if resp.StatusCode != 200 && resp.StatusCode != 404 {
71+
return resp, errors.New("Bad response status: " + resp.Status + " >> " + url)
72+
}
73+
7374
return resp, nil
7475
}
7576

0 commit comments

Comments
 (0)