Merge pull request #53866 from nextcloud/chore/update-guzzle7

build(deps): Bump php-http/guzzle7-adapter from 1.0.0 to 1.1.0
This commit is contained in:
Joas Schilling 2025-07-09 16:18:05 +02:00 committed by GitHub
commit f077bb55f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 13 deletions

@ -1 +1 @@
Subproject commit feff92626b298768baad0ed37ab9801627c8c546
Subproject commit ea127103c578c964009944f7748f245024c97e2e

View file

@ -13,23 +13,15 @@ use OCP\Http\Client\LocalServerException;
use Psr\Http\Message\RequestInterface;
class DnsPinMiddleware {
/** @var NegativeDnsCache */
private $negativeDnsCache;
private IpAddressClassifier $ipAddressClassifier;
public function __construct(
NegativeDnsCache $negativeDnsCache,
IpAddressClassifier $ipAddressClassifier,
private NegativeDnsCache $negativeDnsCache,
private IpAddressClassifier $ipAddressClassifier,
) {
$this->negativeDnsCache = $negativeDnsCache;
$this->ipAddressClassifier = $ipAddressClassifier;
}
/**
* Fetch soa record for a target
*
* @param string $target
* @return array|null
*/
private function soaRecord(string $target): ?array {
$labels = explode('.', $target);
@ -99,7 +91,7 @@ class DnsPinMiddleware {
return \dns_get_record($hostname, $type);
}
public function addDnsPinning() {
public function addDnsPinning(): callable {
return function (callable $handler) {
return function (
RequestInterface $request,
@ -109,7 +101,7 @@ class DnsPinMiddleware {
return $handler($request, $options);
}
$hostName = (string)$request->getUri()->getHost();
$hostName = $request->getUri()->getHost();
$port = $request->getUri()->getPort();
$ports = [