mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-01-06 15:55:48 +08:00
增加一些注释、测试等
This commit is contained in:
@@ -853,6 +853,7 @@ func (this *HTTPRequest) requestServerPort() int {
|
||||
|
||||
// 设置代理相关头部信息
|
||||
// 参考:https://tools.ietf.org/html/rfc7239
|
||||
// TODO X-Forwarded-* 系列做成可选项,避免有些源站屏蔽此项
|
||||
func (this *HTTPRequest) setForwardHeaders(header http.Header) {
|
||||
if this.RawReq.Header.Get("Connection") == "close" {
|
||||
this.RawReq.Header.Set("Connection", "keep-alive")
|
||||
|
||||
@@ -84,6 +84,7 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir
|
||||
countryId := iplibrary.SharedCountryManager.Lookup(result.Country)
|
||||
if countryId > 0 && lists.ContainsInt64(regionConfig.DenyCountryIds, countryId) {
|
||||
// TODO 可以配置对封禁的处理方式等
|
||||
// TODO 需要记录日志信息
|
||||
this.writer.WriteHeader(http.StatusForbidden)
|
||||
this.writer.Close()
|
||||
|
||||
@@ -99,6 +100,7 @@ func (this *HTTPRequest) checkWAFRequest(firewallPolicy *firewallconfigs.HTTPFir
|
||||
provinceId := iplibrary.SharedProvinceManager.Lookup(result.Province)
|
||||
if provinceId > 0 && lists.ContainsInt64(regionConfig.DenyProvinceIds, provinceId) {
|
||||
// TODO 可以配置对封禁的处理方式等
|
||||
// TODO 需要记录日志信息
|
||||
this.writer.WriteHeader(http.StatusForbidden)
|
||||
this.writer.Close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user