修复CDN环境下获取真实客户端IP的问题
This commit is contained in:
+1
-1
@@ -306,7 +306,7 @@ func recordArticleView(db *gorm.DB, articleID uint, c *gin.Context) {
|
||||
}
|
||||
|
||||
// Get client IP and User-Agent
|
||||
ip := c.ClientIP()
|
||||
ip := GetClientIP(c)
|
||||
userAgent := c.Request.UserAgent()
|
||||
isBot := models.IsBot(userAgent)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user