From adcdb94d99ec7ceccebe452e7ac0feb11029b5f4 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 17 Jan 2018 12:27:29 +0100 Subject: [PATCH] Allow comments in the fowarding rules --- dnscrypt-proxy/plugin_forward.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dnscrypt-proxy/plugin_forward.go b/dnscrypt-proxy/plugin_forward.go index 1c5a6800..074c4020 100644 --- a/dnscrypt-proxy/plugin_forward.go +++ b/dnscrypt-proxy/plugin_forward.go @@ -35,8 +35,12 @@ func (plugin *PluginForward) Init(proxy *Proxy) error { return err } for lineNo, line := range strings.Split(string(bin), "\n") { + line = strings.Trim(line, " \t\r") + if len(line) == 0 || strings.HasPrefix(line, "#") { + continue + } parts := strings.SplitN(line, ":", 2) - if len(parts) == 0 || len(strings.Trim(parts[0], " \t\r")) == 0 { + if len(parts) == 0 { continue } if len(parts) != 2 {