Fix seek endpoint metadata for endpoints with path params

This commit is contained in:
Синельник Тимур Романович committed 2026-03-03 16:44:26 +03:00
1 parent e623018b72
commit 211b47d21e
1 file changed
+6 -9
+6 -9
View File
@@ -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)
}