add method to handlers
This commit is contained in:
@@ -16,7 +16,7 @@ func RequestID(skipPaths []string) gin.HandlerFunc {
|
||||
id = uuid.NewString()
|
||||
}
|
||||
if len(skipPaths) > 0 && !slices.Contains(skipPaths, c.Request.URL.Path) {
|
||||
logger.Info("RequestID", "id", id)
|
||||
logger.Info("RequestID", "id", id, "path", c.Request.URL.Path)
|
||||
}
|
||||
c.Set("request_id", id)
|
||||
c.Writer.Header().Set("X-Request-ID", id)
|
||||
|
||||
Reference in New Issue
Block a user