all repos — elgit @ f41c7baefd86bf8db0e5f096c449997d9427f813

fork of legit: web frontend for git, written in go

configure golangci-lint

Alan Pearce
commit

f41c7baefd86bf8db0e5f096c449997d9427f813

parent

721a55a5b5ab180d4828e8de8175b24ca8d244f3

1 file changed, 7 insertions(+), 1 deletion(-)

changed files
M main.gomain.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()) }