修复CDN环境下获取真实客户端IP的问题
This commit is contained in:
+1
-1
@@ -183,7 +183,7 @@ func PostComment(db *gorm.DB) gin.HandlerFunc {
|
||||
Content: sanitizeMarkdown(form.Content),
|
||||
IsPrivate: form.IsPrivate,
|
||||
Status: models.CommentApproved,
|
||||
IPAddress: truncate(c.ClientIP(), 64),
|
||||
IPAddress: truncate(GetClientIP(c), 64),
|
||||
UserAgent: truncate(c.GetHeader("User-Agent"), 512),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user