diff --git a/cmd/screenjournal/main.go b/cmd/screenjournal/main.go index 61a4015f..1e5efe84 100644 --- a/cmd/screenjournal/main.go +++ b/cmd/screenjournal/main.go @@ -8,6 +8,7 @@ import ( "os" "path/filepath" "strconv" + "time" gorilla "github.com/mtlynch/gorilla-handlers" @@ -78,7 +79,14 @@ func main() { } log.Printf("listening on %s", port) - log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil)) + server := &http.Server{ + Addr: fmt.Sprintf(":%s", port), + ReadHeaderTimeout: 5 * time.Second, + ReadTimeout: 15 * time.Second, + WriteTimeout: 15 * time.Second, + IdleTimeout: 60 * time.Second, + } + log.Fatal(server.ListenAndServe()) } func requireEnv(key string) string {