diff --git a/lib/private/Http/Client/DnsPinMiddleware.php b/lib/private/Http/Client/DnsPinMiddleware.php index ee0ea053dcfe6..a59b1dd3c70e6 100644 --- a/lib/private/Http/Client/DnsPinMiddleware.php +++ b/lib/private/Http/Client/DnsPinMiddleware.php @@ -25,6 +25,7 @@ */ namespace OC\Http\Client; +use OCP\Http\Client\LocalServerException; use Psr\Http\Message\RequestInterface; class DnsPinMiddleware { @@ -127,6 +128,10 @@ public function addDnsPinning() { $targetIps = $this->dnsResolve($hostName, 0); + if (empty($targetIps)) { + throw new LocalServerException('No DNS record found for ' . $hostName); + } + $curlResolves = []; foreach ($ports as $port) {