enh: skip processing for empty response

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2023-09-04 15:18:37 +02:00
parent 35ff1de807
commit 07ab666d84
No known key found for this signature in database
GPG key ID: 36E3664E099D0614

View file

@ -25,6 +25,7 @@ declare(strict_types=1);
*/
namespace OC\Http\Client;
use OCP\Http\Client\LocalServerException;
use Psr\Http\Message\RequestInterface;
class DnsPinMiddleware {
@ -127,6 +128,10 @@ class DnsPinMiddleware {
$targetIps = $this->dnsResolve(idn_to_utf8($hostName), 0);
if (empty($targetIps)) {
throw new LocalServerException('No DNS record found for ' . $hostName);
}
$curlResolves = [];
foreach ($ports as $port) {