Skip to content

Commit

Permalink
修复限流不返回报错信息的bug (#1966)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-lz authored Dec 17, 2024
1 parent d24eeef commit f6c2ce4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/middleware/limit_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type LimitConfig struct {
func (l LimitConfig) LimitWithTime() gin.HandlerFunc {
return func(c *gin.Context) {
if err := l.CheckOrMark(l.GenerationKey(c), l.Expire, l.Limit); err != nil {
c.JSON(http.StatusOK, gin.H{"code": response.ERROR, "msg": err})
c.JSON(http.StatusOK, gin.H{"code": response.ERROR, "msg": err.Error()})
c.Abort()
return
} else {
Expand Down

0 comments on commit f6c2ce4

Please sign in to comment.