From 8f60d61ff910f4f09703aef29ffa56f28a74f34c Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Sat, 21 Sep 2019 10:30:43 +0800 Subject: [PATCH] Fix(fake-ip): return failed when type is AAAA --- dns/middleware.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dns/middleware.go b/dns/middleware.go index 6d30f8d6..bd0aa7d9 100644 --- a/dns/middleware.go +++ b/dns/middleware.go @@ -16,7 +16,11 @@ func withFakeIP(fakePool *fakeip.Pool) middleware { return func(next handler) handler { return func(w D.ResponseWriter, r *D.Msg) { q := r.Question[0] - if q.Qtype != D.TypeA && q.Qtype != D.TypeAAAA { + + if q.Qtype == D.TypeAAAA { + D.HandleFailed(w, r) + return + } else if q.Qtype != D.TypeA { next(w, r) return }