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