File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,14 +43,10 @@ func (plugin *PluginAllowName) Init(proxy *Proxy) error {
4343 parts := strings .Fields (line )
4444 timeRangeName := ""
4545 if len (parts ) == 2 {
46- if timeRangeParts := strings .Split (parts [1 ], "@" ); len (timeRangeParts ) == 2 {
47- timeRangeName = strings .TrimSpace (timeRangeParts [1 ])
48- } else {
49- dlog .Errorf ("Syntax error in allowed names at line %d" , 1 + lineNo )
50- continue
51- }
46+ line = strings .TrimSpace (parts [0 ])
47+ timeRangeName = strings .TrimSpace (parts [1 ])
5248 } else if len (parts ) > 2 {
53- dlog .Errorf ("Syntax error in allowed names at line %d" , 1 + lineNo )
49+ dlog .Errorf ("Syntax error in allowed names at line %d -- Unexpected @ character " , 1 + lineNo )
5450 continue
5551 }
5652 var weeklyRanges * WeeklyRanges
Original file line number Diff line number Diff line change @@ -97,17 +97,13 @@ func (plugin *PluginBlockName) Init(proxy *Proxy) error {
9797 if len (line ) == 0 {
9898 continue
9999 }
100- parts := strings .Fields (line )
100+ parts := strings .Split (line , "@" )
101101 timeRangeName := ""
102102 if len (parts ) == 2 {
103- if timeRangeParts := strings .Split (parts [1 ], "@" ); len (timeRangeParts ) == 2 {
104- timeRangeName = strings .TrimSpace (timeRangeParts [1 ])
105- } else {
106- dlog .Errorf ("Syntax error in block rules at line %d" , 1 + lineNo )
107- continue
108- }
103+ line = strings .TrimSpace (parts [0 ])
104+ timeRangeName = strings .TrimSpace (parts [1 ])
109105 } else if len (parts ) > 2 {
110- dlog .Errorf ("Syntax error in block rules at line %d" , 1 + lineNo )
106+ dlog .Errorf ("Syntax error in block rules at line %d -- Unexpected @ character " , 1 + lineNo )
111107 continue
112108 }
113109 var weeklyRanges * WeeklyRanges
You can’t perform that action at this time.
0 commit comments