Merge branch 'routes_fix' into 'dev'

Fix seek endpoint metadata for endpoints with path params

See merge request isp/isp-gate-service!30
This commit is contained in:
Синельник Тимур Романович committed 2026-03-04 17:55:45 +03:00
commit d417e202e0
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)
}