mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-04 02:14:40 +01:00
Revert "Print an error if a block/allow rule contains more than a pattern"
This reverts commit 6e8628f796
.
This commit is contained in:
parent
69019b7a80
commit
4c29840040
2 changed files with 7 additions and 15 deletions
|
@ -43,14 +43,10 @@ func (plugin *PluginAllowName) Init(proxy *Proxy) error {
|
|||
parts := strings.Fields(line)
|
||||
timeRangeName := ""
|
||||
if len(parts) == 2 {
|
||||
if timeRangeParts := strings.Split(parts[1], "@"); len(timeRangeParts) == 2 {
|
||||
timeRangeName = strings.TrimSpace(timeRangeParts[1])
|
||||
} else {
|
||||
dlog.Errorf("Syntax error in allowed names at line %d", 1+lineNo)
|
||||
continue
|
||||
}
|
||||
line = strings.TrimSpace(parts[0])
|
||||
timeRangeName = strings.TrimSpace(parts[1])
|
||||
} else if len(parts) > 2 {
|
||||
dlog.Errorf("Syntax error in allowed names at line %d", 1+lineNo)
|
||||
dlog.Errorf("Syntax error in allowed names at line %d -- Unexpected @ character", 1+lineNo)
|
||||
continue
|
||||
}
|
||||
var weeklyRanges *WeeklyRanges
|
||||
|
|
|
@ -97,17 +97,13 @@ func (plugin *PluginBlockName) Init(proxy *Proxy) error {
|
|||
if len(line) == 0 {
|
||||
continue
|
||||
}
|
||||
parts := strings.Fields(line)
|
||||
parts := strings.Split(line, "@")
|
||||
timeRangeName := ""
|
||||
if len(parts) == 2 {
|
||||
if timeRangeParts := strings.Split(parts[1], "@"); len(timeRangeParts) == 2 {
|
||||
timeRangeName = strings.TrimSpace(timeRangeParts[1])
|
||||
} else {
|
||||
dlog.Errorf("Syntax error in block rules at line %d", 1+lineNo)
|
||||
continue
|
||||
}
|
||||
line = strings.TrimSpace(parts[0])
|
||||
timeRangeName = strings.TrimSpace(parts[1])
|
||||
} else if len(parts) > 2 {
|
||||
dlog.Errorf("Syntax error in block rules at line %d", 1+lineNo)
|
||||
dlog.Errorf("Syntax error in block rules at line %d -- Unexpected @ character", 1+lineNo)
|
||||
continue
|
||||
}
|
||||
var weeklyRanges *WeeklyRanges
|
||||
|
|
Loading…
Add table
Reference in a new issue