mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 13:10:24 +08:00 
			
		
		
		
	初始化访客IP配置时去除首尾可能的空格
This commit is contained in:
		@@ -19,6 +19,7 @@ type HTTPRemoteAddrConfig struct {
 | 
			
		||||
 | 
			
		||||
// Init 初始化
 | 
			
		||||
func (this *HTTPRemoteAddrConfig) Init() error {
 | 
			
		||||
	this.Value = strings.TrimSpace(this.Value)
 | 
			
		||||
	if len(this.Value) == 0 {
 | 
			
		||||
		this.isEmpty = true
 | 
			
		||||
	} else if regexp.MustCompile(`\s+`).ReplaceAllString(this.Value, "") == "${remoteAddr}" {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user