]> git.ipfire.org Git - thirdparty/bind9.git/commit
DoH: Set the "max-age" "Cache-Control" HTTP header value
authorArtem Boldariev <artem@boldariev.com>
Tue, 12 Oct 2021 13:58:45 +0000 (16:58 +0300)
committerArtem Boldariev <artem@boldariev.com>
Fri, 5 Nov 2021 12:14:59 +0000 (14:14 +0200)
commit51a2c7aed3b72a3fce3148ab81d950c2436cfdbb
tree11b166d6ade64343bd439a3ee31723fbfa2e5e87
parent80482f8d3e42edcfbd98eec61f1760205c2e15e9
DoH: Set the "max-age" "Cache-Control" HTTP header value

This commit makes BIND set the "max-age" value of the "Cache-Control"
HTTP header to the minimal TTL from the Answer section for positive
answers, as RFC 8484 advises in section 5.1.

We calculate the minimal TTL as a side effect of rendering the
response DNS message, so it does not change the code flow much, nor
should it have any measurable negative impact on the performance.

For negative answers, the "max-age" value is set using the TTL and
SOA-minimum values from an SOA record in the Authority section.
lib/dns/include/dns/message.h
lib/dns/message.c
lib/ns/client.c