linting: G112: Potential Slowloris Attack
Picking 2 seconds, although that's just a randomly picked timeout;
given that this is only for testing, it's not too important.
e2e/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(),
}
@@ -6,6 +6,7 @@ import (
"net/http"
"os"
"path/filepath"
+ "time"
)
func main() {
@@ -25,6 +26,7 @@ func main() {
server := http.Server{
Addr: l.Addr().String(),
Handler: http.NewServeMux(),
+ ReadHeaderTimeout: 2 * time.Second, // G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server
}
mux.HandleFunc("/Plugin.Activate", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/vnd.docker.plugins.v1.1+json")
