From 70aef9f502a705f3a358f4b18c761d4728f60708 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 28 Aug 2019 17:07:29 +0200 Subject: [PATCH] gosec: add ignore comments for reported issues that can be ignored ``` builder/remotecontext/remote.go:48: G107: Potential HTTP request made with variable url (gosec) builder/remotecontext/git/gitutils.go:145: G107: Potential HTTP request made with variable url (gosec) builder/remotecontext/git/gitutils.go:147: G107: Potential HTTP request made with variable url (gosec) pkg/fileutils/fileutils_test.go:185: G303: File creation in shared tmp directory without using ioutil.Tempfile (gosec) pkg/tarsum/tarsum_test.go:7: G501: Blacklisted import `crypto/md5`: weak cryptographic primitive (gosec) pkg/tarsum/tarsum_test.go:9: G505: Blacklisted import `crypto/sha1`: weak cryptographic primitive (gosec) ``` Signed-off-by: Sebastiaan van Stijn --- cli/command/image/build/internal/git/gitutils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/command/image/build/internal/git/gitutils.go b/cli/command/image/build/internal/git/gitutils.go index 6213963db2..cfcf648725 100644 --- a/cli/command/image/build/internal/git/gitutils.go +++ b/cli/command/image/build/internal/git/gitutils.go @@ -142,9 +142,9 @@ func supportsShallowClone(remoteURL string) bool { serviceURL := remoteURL + "/info/refs?service=git-upload-pack" // Try a HEAD request and fallback to a Get request on error - res, err := http.Head(serviceURL) + res, err := http.Head(serviceURL) // #nosec G107 if err != nil || res.StatusCode != http.StatusOK { - res, err = http.Get(serviceURL) + res, err = http.Get(serviceURL) // #nosec G107 if err == nil { res.Body.Close() }