mirror of https://github.com/gin-gonic/gin.git
Reduced limit
This commit is contained in:
parent
313d05ed68
commit
d05b31ed77
|
@ -9,7 +9,7 @@ var ips = stats.New()
|
||||||
func ratelimit(c *gin.Context) {
|
func ratelimit(c *gin.Context) {
|
||||||
ip := c.ClientIP()
|
ip := c.ClientIP()
|
||||||
value := ips.Add(ip, 1)
|
value := ips.Add(ip, 1)
|
||||||
if value > 1000 {
|
if value > 400 {
|
||||||
c.AbortWithStatus(401)
|
c.AbortWithStatus(401)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue