[agent/codex:gpt-5.4-mini] Read docs/RFC.md fully. Find ONE feature described in the sp... #26
2 changed files with 27 additions and 4 deletions
4
serve.go
4
serve.go
|
|
@ -204,10 +204,6 @@ func (handler *dnsRequestHandler) ServeDNS(responseWriter dnsprotocol.ResponseWr
|
|||
return
|
||||
}
|
||||
|
||||
if len(reply.Answer) == 0 {
|
||||
goto noRecord
|
||||
}
|
||||
|
||||
_ = responseWriter.WriteMsg(reply)
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -975,6 +975,33 @@ func TestServiceServeReturnsNXDOMAINWhenMissing(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestServiceServeReturnsNoErrorWhenTypeIsMissing(t *testing.T) {
|
||||
service := NewService(ServiceOptions{
|
||||
Records: map[string]NameRecords{
|
||||
"gateway.charon.lthn": {
|
||||
A: []string{"10.10.10.10"},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
srv, err := service.Serve("127.0.0.1", 0)
|
||||
if err != nil {
|
||||
t.Fatalf("expected server to start: %v", err)
|
||||
}
|
||||
defer func() { _ = srv.Close() }()
|
||||
|
||||
client := dnsprotocol.Client{}
|
||||
request := new(dnsprotocol.Msg)
|
||||
request.SetQuestion("gateway.charon.lthn.", dnsprotocol.TypeTXT)
|
||||
response := exchangeWithRetry(t, client, request, srv.Address())
|
||||
if response.Rcode != dnsprotocol.RcodeSuccess {
|
||||
t.Fatalf("expected NOERROR for existing name without TXT records, got %d", response.Rcode)
|
||||
}
|
||||
if len(response.Answer) != 0 {
|
||||
t.Fatalf("expected empty answer for missing TXT record, got %#v", response.Answer)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceHandleActionResolveAndTXTAndAll(t *testing.T) {
|
||||
service := NewService(ServiceOptions{
|
||||
Records: map[string]NameRecords{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue