From 2f6dcb724b565b1e62c3021b2b7bd8c08fbedbd8 Mon Sep 17 00:00:00 2001 From: NewName Date: Sun, 18 May 2025 15:54:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=95=9C=E5=83=8F=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ghproxy/skopeo_service.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ghproxy/skopeo_service.go b/ghproxy/skopeo_service.go index 1e7c0d9..011800b 100644 --- a/ghproxy/skopeo_service.go +++ b/ghproxy/skopeo_service.go @@ -360,6 +360,12 @@ func handleDownload(c *gin.Context) { return } + // 添加镜像数量限制10个,防止恶意刷流量 + if len(req.Images) > 10 { + c.JSON(http.StatusBadRequest, gin.H{"error": "您下载的数量太多,宝宝承受不住"}) + return + } + // 创建新任务 taskID := generateTaskID() tempDir := filepath.Join("./temp", taskID)