🎨打印日志看输出
Some checks reported errors
continuous-integration/drone/tag Build was killed

This commit is contained in:
coward 2024-08-21 16:39:30 +08:00
parent 1a5ab341ab
commit 1b28b196a0

View File

@ -59,6 +59,8 @@ func RequestLog() gin.HandlerFunc {
}
ua := c.Request.UserAgent() // UA
log.Debugf("真实IP是: %v === clientIP是 %v", c.Request.Header.Get("X-Real-Ip"), ip)
// 重写客户端IP
c.Request.Header.Set("X-Forwarded-For", ip)
c.Request.Header.Set("X-Real-IP", ip)