From 2b4e3b6b01338003141fc10c0f4e2bde4a2f5493 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Wed, 11 Feb 2026 18:04:15 +0100 Subject: [PATCH] Enable Gin's context fallback (#409) --- internal/controller/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/controller/api.go b/internal/controller/api.go index 4cbf3d5..48dc3ef 100644 --- a/internal/controller/api.go +++ b/internal/controller/api.go @@ -30,6 +30,10 @@ var ErrUnauthorized = errors.New("unauthorized") func (controller *Controller) initAPI() *gin.Engine { ginEngine := gin.New() + // Enable Gin's context fallback to make (*gin.Context).Done() work + // and to avoid calling the (*gin.Context).Request.Context().Done() + ginEngine.ContextWithFallback = true + var group *gin.RouterGroup if controller.apiPrefix != "" {