This commit is contained in:
2022-01-19 19:39:04 +08:00
parent 61c2b8264d
commit ab78141e7d
36 changed files with 1939 additions and 211 deletions
+2 -1
View File
@@ -65,7 +65,8 @@ func GetFibberRecoverConfig() recover.Config {
// FibberUserCtxWithTraceHandler 把fibberCtx的traceId 置入UserCtx中
func FibberUserCtxWithTraceHandler(c *fiber.Ctx) error {
c.SetUserContext(context.WithValue(context.Background(), fiber.HeaderXRequestID, c.Response().Header.Peek(fiber.HeaderXRequestID)))
peek := c.Response().Header.Peek(fiber.HeaderXRequestID)
c.SetUserContext(context.WithValue(context.Background(), fiber.HeaderXRequestID, string(peek)))
return c.Next()
}