[change] control: add upstreams validation before dns config test

This commit is contained in:
Aleksey Dmitrevskiy 2019-03-06 18:36:31 +03:00
parent bc4c2e2ff7
commit ac131923a2

View file

@ -418,6 +418,10 @@ func handleTestUpstreamDNS(w http.ResponseWriter, r *http.Request) {
}
func checkDNS(input string, bootstrap []string) error {
if err := validateUpstream(input); err != nil {
return fmt.Errorf("wrong upstream format: %s", err)
}
if len(bootstrap) == 0 {
bootstrap = defaultBootstrap
}