mirror of
https://github.com/danog/dns.git
synced 2024-11-30 04:29:06 +01:00
Restrict caching to max one day
This commit is contained in:
parent
2167251966
commit
cbffb766f3
@ -223,9 +223,10 @@ final class BasicResolver implements Resolver {
|
||||
/** @var \LibDNS\Records\Resource $record */
|
||||
foreach ($answers as $record) {
|
||||
$recordType = $record->getType();
|
||||
|
||||
$result[$recordType][] = (string) $record->getData();
|
||||
$ttls[$recordType] = \min($ttls[$recordType] ?? \PHP_INT_MAX, $record->getTTL());
|
||||
|
||||
// Cache for max one day
|
||||
$ttls[$recordType] = \min($ttls[$recordType] ?? 86400, $record->getTTL());
|
||||
}
|
||||
|
||||
foreach ($result as $recordType => $records) {
|
||||
|
Loading…
Reference in New Issue
Block a user