给Github下载也应用IP限流

This commit is contained in:
NewName
2025-05-17 16:37:23 +08:00
parent e7a88a3941
commit b0b4c00ccc
2 changed files with 5 additions and 23 deletions

View File

@@ -96,8 +96,9 @@ func main() {
c.File("./public/bj.svg")
})
// 最后才注册NoRoute处理器处理不能直接匹配的路径
router.NoRoute(handler)
// 注册NoRoute处理器应用限流中间件
// 为GitHub文件下载应用限流
ApplyRateLimit(router, "*", "GET", handler)
err := router.Run(fmt.Sprintf("%s:%d", host, port))
if err != nil {