Skip to content

Commit 41e0fcf

Browse files
authored
Merge pull request nextcloud#40261 from nextcloud/backport/40234/stable25
[stable25] enh: skip processing for empty response
2 parents cb607b5 + 07ab666 commit 41e0fcf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/private/Http/Client/DnsPinMiddleware.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*/
2626
namespace OC\Http\Client;
2727

28+
use OCP\Http\Client\LocalServerException;
2829
use Psr\Http\Message\RequestInterface;
2930

3031
class DnsPinMiddleware {
@@ -127,6 +128,10 @@ public function addDnsPinning() {
127128

128129
$targetIps = $this->dnsResolve(idn_to_utf8($hostName), 0);
129130

131+
if (empty($targetIps)) {
132+
throw new LocalServerException('No DNS record found for ' . $hostName);
133+
}
134+
130135
$curlResolves = [];
131136

132137
foreach ($ports as $port) {

0 commit comments

Comments
 (0)