mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 05:00:24 +08:00 
			
		
		
		
	请求变量增加${cname},WAF checkpoint增加cname和isCNAME
This commit is contained in:
		@@ -23,4 +23,5 @@ type HTTPFirewallCheckpointDefinition struct {
 | 
			
		||||
	Options     []OptionInterface `json:"options"`     // 选项
 | 
			
		||||
	IsComposed  bool              `json:"isComposed"`  // 是否为组合的checkpoint
 | 
			
		||||
	Priority    int               `json:"priority"`    // 优先级
 | 
			
		||||
	DataType    string            `json:"dataType"`    // 数据类型:number, bool等
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -152,6 +152,21 @@ var AllCheckpoints = []*HTTPFirewallCheckpointDefinition{
 | 
			
		||||
		IsRequest:   true,
 | 
			
		||||
		Priority:    100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		Name:        "CNAME",
 | 
			
		||||
		Prefix:      "cname",
 | 
			
		||||
		Description: "当前网站服务CNAME,比如38b48e4f.goedge.cn",
 | 
			
		||||
		IsRequest:   true,
 | 
			
		||||
		Priority:    100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		Name:        "是否为CNAME",
 | 
			
		||||
		Prefix:      "isCNAME",
 | 
			
		||||
		Description: "是否为CNAME,值为1(是)或0(否)",
 | 
			
		||||
		IsRequest:   true,
 | 
			
		||||
		Priority:    100,
 | 
			
		||||
		DataType:    "bool",
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		Name:        "请求来源URL",
 | 
			
		||||
		Prefix:      "referer",
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,7 @@ func DefaultRequestVariables() []maps.Map {
 | 
			
		||||
		{"code": "${msec}", "name": "带有毫秒的时间", "description": "比如1531756823.054"},
 | 
			
		||||
		{"code": "${timestamp}", "name": "unix时间戳,单位为秒", "description": ""},
 | 
			
		||||
		{"code": "${host}", "name": "主机名", "description": ""},
 | 
			
		||||
		{"code": "${cname}", "name": "当前网站的CNAME", "description": "比如38b48e4f.goedge.cn"},
 | 
			
		||||
		{"code": "${serverName}", "name": "接收请求的服务器名", "description": ""},
 | 
			
		||||
		{"code": "${serverPort}", "name": "接收请求的服务器端口", "description": ""},
 | 
			
		||||
		{"code": "${referer}", "name": "请求来源URL", "description": ""},
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user