diff --git a/internal/nodes/http_request.go b/internal/nodes/http_request.go index 8216b87..35b0ba1 100644 --- a/internal/nodes/http_request.go +++ b/internal/nodes/http_request.go @@ -193,10 +193,11 @@ func (this *HTTPRequest) Do() { } // 套餐 - if this.ReqServer.UserPlan != nil && !this.ReqServer.UserPlan.IsAvailable() { - this.doPlanExpires() - this.doEnd() - return + if this.ReqServer.UserPlan != nil { + if this.doPlanBefore() { + this.doEnd() + return + } } // 流量限制 diff --git a/internal/nodes/http_request_plan_before.go b/internal/nodes/http_request_plan_before.go new file mode 100644 index 0000000..1f872e0 --- /dev/null +++ b/internal/nodes/http_request_plan_before.go @@ -0,0 +1,10 @@ +// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. +//go:build !plus + +package nodes + +// 检查套餐 +func (this *HTTPRequest) doPlanBefore() (blocked bool) { + // stub + return false +} diff --git a/internal/nodes/http_request_plan_expires.go b/internal/nodes/http_request_plan_expires.go deleted file mode 100644 index 51baba7..0000000 --- a/internal/nodes/http_request_plan_expires.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. - -package nodes - -import ( - "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" - "net/http" -) - -// 套餐过期 -func (this *HTTPRequest) doPlanExpires() { - this.tags = append(this.tags, "plan") - - var statusCode = http.StatusNotFound - this.ProcessResponseHeaders(this.writer.Header(), statusCode) - - this.writer.WriteHeader(statusCode) - _, _ = this.writer.WriteString(this.Format(serverconfigs.DefaultPlanExpireNoticePageBody)) -}