请求特殊页面
(status int)
| 15 | |
| 16 | // 请求特殊页面 |
| 17 | func (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 | |
| 47 | func (this *HTTPRequest) doPageLookup(pages []*serverconfigs.HTTPPageConfig, status int) (shouldStop bool) { |
| 48 | var url = this.URL() |
no test coverage detected