Skip to content

Commit a67f7a3

Browse files
committed
Fix: Filter out empty IP addresses in dnsResolve method
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]>
1 parent 66ab45b commit a67f7a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/private/Http/Client/DnsPinMiddleware.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ private function dnsResolve(string $target, int $recursionCount) : array {
101101
}
102102
}
103103

104-
return $targetIps;
104+
// Filter out empty IP addresses before returning the result
105+
return array_filter($targetIps, function($ip) {
106+
return !empty($ip);
107+
});
105108
}
106109

107110
public function addDnsPinning() {

0 commit comments

Comments
 (0)