diff --git a/internal/nodes/http_request_user_agent.go b/internal/nodes/http_request_user_agent.go index 9890f84..c607bc0 100644 --- a/internal/nodes/http_request_user_agent.go +++ b/internal/nodes/http_request_user_agent.go @@ -13,7 +13,7 @@ func (this *HTTPRequest) doCheckUserAgent() (shouldStop bool) { const cacheSeconds = "3600" // 时间不能过长,防止修改设置后长期无法生效 - if !this.web.UserAgent.AllowRequest(this.RawReq) { + if this.web.UserAgent.MatchURL(this.URL()) && !this.web.UserAgent.AllowRequest(this.RawReq) { this.tags = append(this.tags, "userAgentCheck") this.writer.Header().Set("Cache-Control", "max-age="+cacheSeconds) this.writeCode(http.StatusForbidden, "The User-Agent has been blocked.", "当前访问已被UA名单拦截。")