mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Add appname and route path to context
This commit is contained in:
@@ -208,10 +208,12 @@ func loggerWrap(c *gin.Context) {
|
|||||||
|
|
||||||
if appName := c.Param(api.CApp); appName != "" {
|
if appName := c.Param(api.CApp); appName != "" {
|
||||||
c.Set(api.AppName, appName)
|
c.Set(api.AppName, appName)
|
||||||
|
c.Request = c.Request.WithContext(context.WithValue(c.Request.Context(), api.AppName, appName))
|
||||||
}
|
}
|
||||||
|
|
||||||
if routePath := c.Param(api.CRoute); routePath != "" {
|
if routePath := c.Param(api.CRoute); routePath != "" {
|
||||||
c.Set(api.Path, routePath)
|
c.Set(api.Path, routePath)
|
||||||
|
c.Request = c.Request.WithContext(context.WithValue(c.Request.Context(), api.Path, routePath))
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Request = c.Request.WithContext(ctx)
|
c.Request = c.Request.WithContext(ctx)
|
||||||
|
|||||||
Reference in New Issue
Block a user