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:
commit
d417e202e0
1 file changed
+6
-9
+6
-9
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user