From 5093eb8e276fe11187ae7b1a2d7cded402406e3c Mon Sep 17 00:00:00 2001 From: Kiyon Date: Sat, 20 Feb 2021 14:31:17 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Fix=20G304=20and=20allow=20G402?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 40493bc7..70556b9c 100644 --- a/client.go +++ b/client.go @@ -348,7 +348,7 @@ func (a *Agent) FileData(formFiles ...*FormFile) *Agent { // SendFile reads file and appends it to multipart form request. func (a *Agent) SendFile(filename string, fieldname ...string) *Agent { - content, err := ioutil.ReadFile(filename) + content, err := ioutil.ReadFile(filepath.Clean(filename)) if err != nil { a.errs = append(a.errs, err) return a @@ -467,8 +467,10 @@ func (a *Agent) Reuse() *Agent { // certificate chain and host name. func (a *Agent) InsecureSkipVerify() *Agent { if a.HostClient.TLSConfig == nil { + /* #nosec G402 */ a.HostClient.TLSConfig = &tls.Config{InsecureSkipVerify: true} } else { + /* #nosec G402 */ a.HostClient.TLSConfig.InsecureSkipVerify = true }