From 1ce48b9ef40223d03b42ac78522858fa7f3a0e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Tue, 13 Dec 2022 18:22:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E8=AE=BE=E7=BD=AE=E4=B8=AD?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=90=9C=E7=B4=A2=E5=BC=95=E6=93=8E=E5=92=8C?= =?UTF-8?q?=E7=88=AC=E8=99=AB=E6=97=B6=E4=B8=8D=E5=8C=BA=E5=88=86=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/web/helpers/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/web/helpers/utils.go b/internal/web/helpers/utils.go index fe7f9f3c..3df5ca4e 100644 --- a/internal/web/helpers/utils.go +++ b/internal/web/helpers/utils.go @@ -112,8 +112,8 @@ func checkIPWithoutCache(config *systemconfigs.SecurityConfig, ipAddr string) bo } // 请求检查相关正则 -var searchEngineRegex = regexp.MustCompile(`60spider|adldxbot|adsbot-google|applebot|admantx|alexa|baidu|bingbot|bingpreview|facebookexternalhit|googlebot|proximic|slurp|sogou|twitterbot|yandex`) -var spiderRegexp = regexp.MustCompile(`python|pycurl|http-client|httpclient|apachebench|nethttp|http_request|java|perl|ruby|scrapy|php|rust|curl|wget`) // 其中增加了curl和wget +var searchEngineRegex = regexp.MustCompile(`(?i)(60spider|adldxbot|adsbot-google|applebot|admantx|alexa|baidu|bingbot|bingpreview|facebookexternalhit|googlebot|proximic|slurp|sogou|twitterbot|yandex)`) +var spiderRegexp = regexp.MustCompile(`(?i)(python|pycurl|http-client|httpclient|apachebench|nethttp|http_request|java|perl|ruby|scrapy|php|rust|curl|wget)`) // 其中增加了curl和wget // 检查请求 func checkRequestSecurity(securityConfig *systemconfigs.SecurityConfig, req *http.Request) bool {