From a01ba5dd4d04bd722cfca2cee950411f3deaabff Mon Sep 17 00:00:00 2001 From: Aleksey Dmitrevskiy Date: Wed, 20 Mar 2019 15:19:34 +0300 Subject: [PATCH] * control, client: fix issues from review --- client/src/components/Settings/Upstream/Examples.js | 2 +- control.go | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/client/src/components/Settings/Upstream/Examples.js b/client/src/components/Settings/Upstream/Examples.js index 9d61b0de..53a233a0 100644 --- a/client/src/components/Settings/Upstream/Examples.js +++ b/client/src/components/Settings/Upstream/Examples.js @@ -22,7 +22,7 @@ const Examples = props => ( sdns://... -
  • - [/host.com/]1.1.1.1 - + [/example.local/]1.1.1.1 -
  • diff --git a/control.go b/control.go index 952395a1..1b05fb73 100644 --- a/control.go +++ b/control.go @@ -369,23 +369,22 @@ func validateUpstreams(upstreams []string) error { return nil } -func validateUpstream(u string) (defaultUpstream bool, err error) { +func validateUpstream(u string) (bool, error) { // Check if user tries to specify upstream for domain - defaultUpstream = true - u, defaultUpstream, err = separateUpstream(u) + u, defaultUpstream, err := separateUpstream(u) if err != nil { - return + return defaultUpstream, err } // The special server address '#' means "use the default servers" if u == "#" && !defaultUpstream { - return + return defaultUpstream, nil } // Check if the upstream has a valid protocol prefix for _, proto := range protocols { if strings.HasPrefix(u, proto) { - return + return defaultUpstream, nil } }