Commit a832ab69 authored by Miek Gieben's avatar Miek Gieben

bugfix: actually *use* the CH class

parent d9b7c947
......@@ -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)
......
......@@ -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{})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment