aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--middleware/chaos/chaos.go2
-rw-r--r--middleware/chaos/chaos_test.go1
2 files changed, 2 insertions, 1 deletions
diff --git a/middleware/chaos/chaos.go b/middleware/chaos/chaos.go
index a7a63c1a1..0064e4f94 100644
--- a/middleware/chaos/chaos.go
+++ b/middleware/chaos/chaos.go
@@ -17,7 +17,7 @@ type Chaos struct {
func (c Chaos) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
state := middleware.State{W: w, Req: r}
- if state.QClass() != dns.ClassINET || state.QType() != dns.TypeTXT {
+ if state.QClass() != dns.ClassCHAOS || state.QType() != dns.TypeTXT {
return c.Next.ServeDNS(ctx, w, r)
}
m := new(dns.Msg)
diff --git a/middleware/chaos/chaos_test.go b/middleware/chaos/chaos_test.go
index 4d01a456e..e8cdef5f1 100644
--- a/middleware/chaos/chaos_test.go
+++ b/middleware/chaos/chaos_test.go
@@ -54,6 +54,7 @@ func TestChaos(t *testing.T) {
test.qtype = dns.TypeTXT
}
req.SetQuestion(dns.Fqdn(test.qname), test.qtype)
+ req.Question[0].Qclass = dns.ClassCHAOS
em.Next = test.next
rec := middleware.NewResponseRecorder(&middleware.TestResponseWriter{})