MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / doPage

Method doPage

internal/nodes/http_request_page.go:17–45  ·  view source on GitHub ↗

请求特殊页面

(status int)

Source from the content-addressed store, hash-verified

15
16// 请求特殊页面
17func (this *HTTPRequest) doPage(status int) (shouldStop bool) {
18 if len(this.web.Pages) == 0 {
19 // 集群自定义页面
20 if this.nodeConfig != nil && this.ReqServer != nil {
21 var httpPagesPolicy = this.nodeConfig.FindHTTPPagesPolicyWithClusterId(this.ReqServer.ClusterId)
22 if httpPagesPolicy != nil && httpPagesPolicy.IsOn && len(httpPagesPolicy.Pages) > 0 {
23 return this.doPageLookup(httpPagesPolicy.Pages, status)
24 }
25 }
26
27 return false
28 }
29
30 // 查找当前网站自定义页面
31 shouldStop = this.doPageLookup(this.web.Pages, status)
32 if shouldStop {
33 return
34 }
35
36 // 集群自定义页面
37 if this.nodeConfig != nil && this.ReqServer != nil {
38 var httpPagesPolicy = this.nodeConfig.FindHTTPPagesPolicyWithClusterId(this.ReqServer.ClusterId)
39 if httpPagesPolicy != nil && httpPagesPolicy.IsOn && len(httpPagesPolicy.Pages) > 0 {
40 return this.doPageLookup(httpPagesPolicy.Pages, status)
41 }
42 }
43
44 return
45}
46
47func (this *HTTPRequest) doPageLookup(pages []*serverconfigs.HTTPPageConfig, status int) (shouldStop bool) {
48 var url = this.URL()

Callers 3

writeCodeMethod · 0.95
write50xMethod · 0.95
doOriginRequestMethod · 0.95

Calls 1

doPageLookupMethod · 0.95

Tested by

no test coverage detected