Use HTTP server read timeout (fixes #805, fixes #806)

This commit is contained in:
Jakob Borg 2014-10-13 19:34:26 +02:00
parent 244a22755c
commit c8a68001c1

View File

@ -154,8 +154,13 @@ func startGUI(cfg config.GUIConfiguration, assetDir string, m *model.Model) erro
handler = redirectToHTTPSMiddleware(handler)
}
srv := http.Server{
Handler: handler,
ReadTimeout: 2 * time.Second,
}
go func() {
err := http.Serve(listener, handler)
err := srv.Serve(listener)
if err != nil {
panic(err)
}