Fix(fake-ip): return failed when type is AAAA

This commit is contained in:
Dreamacro 2019-09-21 10:30:43 +08:00
parent 5e6ab99403
commit 8f60d61ff9

View file

@ -16,7 +16,11 @@ func withFakeIP(fakePool *fakeip.Pool) middleware {
return func(next handler) handler { return func(next handler) handler {
return func(w D.ResponseWriter, r *D.Msg) { return func(w D.ResponseWriter, r *D.Msg) {
q := r.Question[0] 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) next(w, r)
return return
} }