fix: set request id into headers instead of context directly
This commit is contained in:
@ -58,12 +58,12 @@ func TestRequestID(t *testing.T) {
|
||||
wanted := "123"
|
||||
|
||||
r.GET("/example", func(c *gin.Context) {
|
||||
got = c.GetString(requestID)
|
||||
got = c.GetHeader(requestID)
|
||||
c.Status(http.StatusOK)
|
||||
})
|
||||
|
||||
r.POST("/example", func(c *gin.Context) {
|
||||
got = c.GetString(requestID)
|
||||
got = c.GetHeader(requestID)
|
||||
c.String(http.StatusAccepted, "ok")
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user