diff --git a/web/routes.go b/web/routes.go index 9d425ca3..0abcb214 100644 --- a/web/routes.go +++ b/web/routes.go @@ -77,6 +77,10 @@ func routes(s *fibre.Fibre) { s.Rpc("/rpc", &rpc{}) + s.Use(mw.Quit(&mw.QuitOpts{ + Timeout: 15 * time.Second, + }).PathIs("/rpc")) + // -------------------------------------------------- // Endpoints for syncing data // -------------------------------------------------- @@ -167,6 +171,10 @@ func routes(s *fibre.Fibre) { return c.Send(200, res) }) + s.Use(mw.Quit(&mw.QuitOpts{ + Timeout: 15 * time.Second, + }).PathIs("/sql")) + s.Use(mw.Type(&mw.TypeOpts{ AllowedContent: map[string]bool{ "text/plain": true, @@ -354,6 +362,10 @@ func routes(s *fibre.Fibre) { }) + s.Use(mw.Quit(&mw.QuitOpts{ + Timeout: 5 * time.Second, + }).PathBegsWith("/key/")) + s.Use(mw.Type(&mw.TypeOpts{ AllowedContent: map[string]bool{ "application/json": true, diff --git a/web/web.go b/web/web.go index b6a494c4..a75ef6b2 100644 --- a/web/web.go +++ b/web/web.go @@ -32,8 +32,6 @@ func Setup(opts *cnf.Options) (err error) { routes(s) s.SetName("web") s.SetIdleTimeout("650s") - s.SetReadTimeout("10s") - s.SetWriteTimeout("10s") s.SetHTTPErrorHandler(errors) s.Logger().SetLogger(log.Instance())