Skip to content

Commit adcdb94

Browse files
committed
Allow comments in the fowarding rules
1 parent ee90d24 commit adcdb94

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

dnscrypt-proxy/plugin_forward.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ func (plugin *PluginForward) Init(proxy *Proxy) error {
3535
return err
3636
}
3737
for lineNo, line := range strings.Split(string(bin), "\n") {
38+
line = strings.Trim(line, " \t\r")
39+
if len(line) == 0 || strings.HasPrefix(line, "#") {
40+
continue
41+
}
3842
parts := strings.SplitN(line, ":", 2)
39-
if len(parts) == 0 || len(strings.Trim(parts[0], " \t\r")) == 0 {
43+
if len(parts) == 0 {
4044
continue
4145
}
4246
if len(parts) != 2 {

0 commit comments

Comments
 (0)