diff --git a/internal/nodes/http_request.go b/internal/nodes/http_request.go index 934bc8a..21b3347 100644 --- a/internal/nodes/http_request.go +++ b/internal/nodes/http_request.go @@ -221,6 +221,18 @@ func (this *HTTPRequest) Do() { } } + // CC + if !isHealthCheck { + if this.web.CC != nil { + if this.web.CC.IsOn { + if this.doCC() { + this.doEnd() + return + } + } + } + } + // WAF if this.web.FirewallRef != nil && this.web.FirewallRef.IsOn { if this.doWAFRequest() { @@ -572,6 +584,11 @@ func (this *HTTPRequest) configureWeb(web *serverconfigs.HTTPWebConfig, isTop bo this.web.UAM = web.UAM } + // CC + if web.CC != nil && (web.CC.IsPrior || isTop) { + this.web.CC = web.CC + } + // 重写规则 if len(web.RewriteRefs) > 0 { for index, ref := range web.RewriteRefs { diff --git a/internal/nodes/http_request_cc.go b/internal/nodes/http_request_cc.go new file mode 100644 index 0000000..b803e19 --- /dev/null +++ b/internal/nodes/http_request_cc.go @@ -0,0 +1,8 @@ +// Copyright 2023 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn . +//go:build !plus + +package nodes + +func (this *HTTPRequest) doCC() (block bool) { + return +}