diff --git a/CHANGELOG.md b/CHANGELOG.md index 358dad93..fcaaa013 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ NOTE: Add new changes BELOW THIS COMMENT. ### Added +- The ability to check filtering rules for host names using an optional query type and optional ClientID or client IP address. - Optional `client` and `qtype` URL query parameters to the `GET /control/check_host` HTTP API. ### Fixed diff --git a/internal/filtering/http.go b/internal/filtering/http.go index eadb3ab2..2a1a33fd 100644 --- a/internal/filtering/http.go +++ b/internal/filtering/http.go @@ -459,8 +459,10 @@ func (d *DNSFilter) handleCheckHost(w http.ResponseWriter, r *http.Request) { addr, err := netip.ParseAddr(cli) if err == nil { + setts.ClientIP = addr d.ApplyAdditionalFiltering(addr, "", setts) } else if cli != "" { + setts.ClientName = cli d.ApplyAdditionalFiltering(netip.Addr{}, cli, setts) }