Commit d6ed957a authored by Marek Vavruša's avatar Marek Vavruša

tests: added tests with empty QD response

parent 56be2ccf
......@@ -63,6 +63,7 @@ static bool is_paired_to_query(const knot_pkt_t *answer, struct kr_query *query)
const knot_dname_t *qname = minimized_qname(query, &qtype);
return query->id == knot_wire_get_id(answer->wire) &&
knot_wire_get_qdcount(answer->wire) > 0 &&
(query->sclass == KNOT_CLASS_ANY || query->sclass == knot_pkt_qclass(answer)) &&
qtype == knot_pkt_qtype(answer) &&
knot_dname_is_equal(qname, knot_pkt_qname(answer));
......
......@@ -104,7 +104,9 @@ class Entry:
answer.use_edns(query.edns, query.ednsflags)
if 'copy_id' in self.adjust_fields:
answer.id = query.id
answer.question[0].name = query.question[0].name
# Copy letter-case if the template has QD
if len(answer.question) > 0:
answer.question[0].name = query.question[0].name
if 'copy_query' in self.adjust_fields:
answer.question = query.question
return answer
......
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