From 211b47d21e1003d8f51b5ada493c8639e1948f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B8=D0=BD=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA=20?= =?UTF-8?q?=D0=A2=D0=B8=D0=BC=D1=83=D1=80=20=D0=A0=D0=BE=D0=BC=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=B8=D1=87?= Date: Tue, 3 Mar 2026 16:44:26 +0300 Subject: [PATCH] Fix seek endpoint metadata for endpoints with path params --- routes/routes.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/routes/routes.go b/routes/routes.go index 3175572..bc6261e 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -105,13 +105,10 @@ func (s *Routes) registerEndpoint( PathSchema: descriptor.Path, } - router.HandlerFunc( - httpMethod, - path, - func(_ http.ResponseWriter, r *http.Request) { - ctx := meta.ToContext(r.Context()) - // хак для передачи метадаты обратно в код - *r = *r.WithContext(ctx) - }, - ) + handler := func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { + ctx := meta.ToContext(r.Context()) + // хак для передачи метадаты обратно в код + *r = *r.WithContext(ctx) + } + router.Handle(httpMethod, path, handler) }