mirror of https://github.com/docker/cli.git
image/build: use "nolint" comment to work around gosec regression
Latest gosec linter has a regression in parsing "nosec" comments; see https://github.com/securego/gosec/issues/1046 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
8bf53ab011
commit
9e1f8d646e
|
@ -234,8 +234,7 @@ func GetContextFromURL(out io.Writer, remoteURL, dockerfileName string) (io.Read
|
||||||
// getWithStatusError does an http.Get() and returns an error if the
|
// getWithStatusError does an http.Get() and returns an error if the
|
||||||
// status code is 4xx or 5xx.
|
// status code is 4xx or 5xx.
|
||||||
func getWithStatusError(url string) (resp *http.Response, err error) {
|
func getWithStatusError(url string) (resp *http.Response, err error) {
|
||||||
// #nosec G107
|
if resp, err = http.Get(url); err != nil { //nolint:gosec // Ignore G107: Potential HTTP request made with variable url
|
||||||
if resp, err = http.Get(url); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if resp.StatusCode < http.StatusBadRequest {
|
if resp.StatusCode < http.StatusBadRequest {
|
||||||
|
|
Loading…
Reference in New Issue