From fb3610966ad2fecf62ac43be607dcc861b2f71df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Mon, 25 Apr 2022 11:11:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95=E4=B8=AD=E7=9A=84IP?= =?UTF-8?q?=E4=B8=8D=E5=8F=97=E8=AF=B7=E6=B1=82=E9=99=90=E5=88=B6=E7=9A=84?= =?UTF-8?q?=E5=BD=B1=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_limit.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/nodes/http_request_limit.go b/internal/nodes/http_request_limit.go index 03067a4..0cdc1d7 100644 --- a/internal/nodes/http_request_limit.go +++ b/internal/nodes/http_request_limit.go @@ -2,9 +2,18 @@ package nodes -import "net/http" +import ( + "github.com/TeaOSLab/EdgeNode/internal/iplibrary" + "net/http" +) func (this *HTTPRequest) doRequestLimit() (shouldStop bool) { + // 是否在全局名单中 + _, isInAllowedList := iplibrary.AllowIP(this.RemoteAddr(), this.ReqServer.Id) + if isInAllowedList { + return false + } + // 检查请求Body尺寸 // TODO 处理分片提交的内容 if this.web.RequestLimit.MaxBodyBytes() > 0 &&