configure golangci-lint
1 file changed, 7 insertions(+), 1 deletion(-)
changed files
M main.go → main.go
@@ -7,6 +7,7 @@ "log" "net" "net/http" "strconv" + "time" "alin.ovh/elgit/config" "alin.ovh/elgit/routes"@@ -34,5 +35,10 @@ mux := routes.Handlers(c, staticFiles) addr := net.JoinHostPort(c.Server.Host, strconv.FormatInt(int64(c.Server.Port), 10)) log.Println("starting server on", addr) - log.Fatal(http.ListenAndServe(addr, mux)) + srv := http.Server{ + Addr: addr, + Handler: mux, + ReadHeaderTimeout: time.Second * 5, + } + log.Fatal(srv.ListenAndServe()) }