[change] control: add upstreams validation before dns config test
This commit is contained in:
parent
bc4c2e2ff7
commit
ac131923a2
|
@ -418,6 +418,10 @@ func handleTestUpstreamDNS(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkDNS(input string, bootstrap []string) error {
|
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 {
|
if len(bootstrap) == 0 {
|
||||||
bootstrap = defaultBootstrap
|
bootstrap = defaultBootstrap
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue