mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-30 17:53:21 -04:00 
			
		
		
		
	bugfix: actually *use* the CH class
This commit is contained in:
		| @@ -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{}) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user