Fix the issue with hanging browser tab.

This commit is contained in:
2025-12-15 14:09:38 +00:00
parent b431221f53
commit be4a7c19d0
2 changed files with 4 additions and 6 deletions
+3 -1
View File
@@ -574,8 +574,9 @@ func (s *Service) verifyStaleObservation(req staleVerifyRequest) {
func (s *Service) setupMiddleware() {
s.router.Use(middleware.Logger)
s.router.Use(middleware.Recoverer)
s.router.Use(middleware.Timeout(DefaultHTTPTimeout))
s.router.Use(middleware.RealIP)
// Note: Timeout middleware is applied per-route, not globally,
// to avoid killing SSE connections which need to stay open indefinitely
}
// setupRoutes configures HTTP routes.
@@ -611,6 +612,7 @@ func (s *Service) setupRoutes() {
// Routes that require DB to be ready
s.router.Group(func(r chi.Router) {
r.Use(s.requireReady)
r.Use(middleware.Timeout(DefaultHTTPTimeout))
// Session routes
r.Post("/api/sessions/init", s.handleSessionInit)
+1 -5
View File
@@ -10,14 +10,10 @@ wording:
- fix
- chore
- docs
- refactor
- test
minor:
- improve
- release
- feat
- feature
- add
- refactor
major:
- breaking
- major