Skip to content

Commit

Permalink
Fix BasicResolver::resolve to break redirect loop
Browse files Browse the repository at this point in the history
Previously we queried domains usually five times (max redirects). It didn't have much impact, because these records were usually cached and immediately returned again, but this resulted in the TTL always being NULL due to cached records being returned.
  • Loading branch information
kelunik committed Sep 12, 2017
1 parent dd6e3c2 commit 1a41089
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/BasicResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public function resolve(string $name, int $typeRestriction = null): Promise {
]);

$records = \array_merge(...$records);

break; // Break redirect loop, otherwise we query the same records 5 times
} catch (MultiReasonException $e) {
foreach ($e->getReasons() as $reason) {
if ($reason instanceof NoRecordException) {
Expand Down

0 comments on commit 1a41089

Please sign in to comment.