Skip to content

Commit

Permalink
Fix: Filter out empty IP addresses in dnsResolve method
Browse files Browse the repository at this point in the history
This commit resolves an issue where empty IP addresses could be returned by the dnsResolve method due to CNAME recursion. The fix filters out empty IP addresses before returning the result, ensuring that only valid, non-empty IP addresses are used in the addDnsPinning method.

Signed-off-by: Robin Winkelewski <[email protected]>
  • Loading branch information
w9n committed Apr 21, 2023
1 parent 66ab45b commit bb26580
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/private/Http/Client/DnsPinMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ private function dnsResolve(string $target, int $recursionCount) : array {
}
}

return $targetIps;
// Filter out empty IP addresses before returning the result
return array_filter($targetIps);
}

public function addDnsPinning() {
Expand Down

0 comments on commit bb26580

Please sign in to comment.