Fix: dns api panic on disable dns section (#2498)
This commit is contained in:
parent
876653ebc8
commit
d16727e2bd
@ -20,6 +20,12 @@ func dnsRouter() http.Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func queryDNS(w http.ResponseWriter, r *http.Request) {
|
func queryDNS(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if resolver.DefaultResolver == nil {
|
||||||
|
render.Status(r, http.StatusInternalServerError)
|
||||||
|
render.JSON(w, r, newError("DNS section is disabled"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
name := r.URL.Query().Get("name")
|
name := r.URL.Query().Get("name")
|
||||||
qTypeStr, _ := lo.Coalesce(r.URL.Query().Get("type"), "A")
|
qTypeStr, _ := lo.Coalesce(r.URL.Query().Get("type"), "A")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user