mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-02 11:56:47 +00:00
Fix: dns api panic on disable dns section (#2498)
This commit is contained in:
1 parent
a6a72a5b54
commit
03520e0d6f
1 file changed
+6
@@ -20,6 +20,12 @@ func dnsRouter() http.Handler {
|
||||
}
|
||||
|
||||
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")
|
||||
qTypeStr, _ := lo.Coalesce(r.URL.Query().Get("type"), "A")
|
||||
|
||||
|
||||
Reference in new issue
Block a user