diff --git a/cli/command/image/build/context.go b/cli/command/image/build/context.go index 1b9f975d9b..b55ec22a5a 100644 --- a/cli/command/image/build/context.go +++ b/cli/command/image/build/context.go @@ -235,7 +235,7 @@ func getWithStatusError(url string) (resp *http.Response, err error) { if resp, err = http.Get(url); err != nil { return nil, err } - if resp.StatusCode < 400 { + if resp.StatusCode < http.StatusBadRequest { return resp, nil } msg := fmt.Sprintf("failed to GET %s with status %s", url, resp.Status) diff --git a/cli/trust/trust.go b/cli/trust/trust.go index df11227e93..bb8aad8524 100644 --- a/cli/trust/trust.go +++ b/cli/trust/trust.go @@ -136,7 +136,7 @@ func GetNotaryRepository(in io.Reader, out io.Writer, userAgent string, repoInfo Timeout: 5 * time.Second, } endpointStr := server + "/v2/" - req, err := http.NewRequest("GET", endpointStr, nil) + req, err := http.NewRequest(http.MethodGet, endpointStr, nil) if err != nil { return nil, err }