diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2022-09-04 14:44:55 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2022-09-04 15:36:51 +0200 |
commit | 31fb92c6099110b6cc036be263ab4cd02e0d2bf7 (patch) | |
tree | 93145faae37a7503fa4a54abbfe5d17ed6355b13 /volume | |
parent | 561a010161d20fa3367b6b7e9efefe04161c1291 (diff) | |
download | docker-31fb92c6099110b6cc036be263ab4cd02e0d2bf7.tar.gz |
linting: gosec: fix or suppress G112, G114 in test code
Updating test-code only; set ReadHeaderTimeout for some, or suppress the linter
error for others.
contrib/httpserver/server.go:11:12: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
log.Panic(http.ListenAndServe(":80", nil))
^
integration/plugin/logging/cmd/close_on_start/main.go:42:12: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
server := http.Server{
Addr: l.Addr().String(),
Handler: mux,
}
integration/plugin/logging/cmd/discard/main.go:17:12: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
server := http.Server{
Addr: l.Addr().String(),
Handler: mux,
}
integration/plugin/logging/cmd/dummy/main.go:14:12: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
server := http.Server{
Addr: l.Addr().String(),
Handler: http.NewServeMux(),
}
integration/plugin/volumes/cmd/dummy/main.go:14:12: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
server := http.Server{
Addr: l.Addr().String(),
Handler: http.NewServeMux(),
}
testutil/fixtures/plugin/basic/basic.go:25:12: G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)
server := http.Server{
Addr: l.Addr().String(),
Handler: http.NewServeMux(),
}
volume/testutils/testutils.go:170:5: G114: Use of net/http serve function that has no support for setting timeouts (gosec)
go http.Serve(l, mux)
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'volume')
-rw-r--r-- | volume/testutils/testutils.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/volume/testutils/testutils.go b/volume/testutils/testutils.go index 0a20a35516..624f76089c 100644 --- a/volume/testutils/testutils.go +++ b/volume/testutils/testutils.go @@ -167,7 +167,7 @@ func MakeFakePlugin(d volume.Driver, l net.Listener) (plugingetter.CompatPlugin, w.Write([]byte("{}")) }) - go http.Serve(l, mux) + go http.Serve(l, mux) // #nosec G114 -- Ignoring for test-code: G114: Use of net/http serve function that has no support for setting timeouts (gosec) return &fakePlugin{client: c, name: d.Name()}, nil } |