Skip to content

Commit

Permalink
dnsforward: imp code
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Nov 21, 2023
1 parent e2612e0 commit 9487f1f
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 155 deletions.
27 changes: 1 addition & 26 deletions internal/dnsforward/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,32 +581,7 @@ func (s *Server) handleTestUpstreamDNS(w http.ResponseWriter, r *http.Request) {
cv.check()
cv.close()

result := map[string]string{}
for _, res := range cv.general {
if res.err != nil {
result[res.original] = res.err.Error()
} else {
result[res.original] = "OK"
}
}

for _, res := range cv.fallback {
if res.err != nil {
result[res.original] = res.err.Error()
} else {
result[res.original] = "OK"
}
}

for _, res := range cv.private {
if res.err != nil {
result[res.original] = res.err.Error()
} else {
result[res.original] = "OK"
}
}

aghhttp.WriteJSONResponseOK(w, r, result)
aghhttp.WriteJSONResponseOK(w, r, cv.status())
}

// handleCacheClear is the handler for the POST /control/cache_clear HTTP API.
Expand Down
Loading

0 comments on commit 9487f1f

Please sign in to comment.