Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/private/Http/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ protected function preventLocalAddress(string $uri, array $options): void {
throw new LocalServerException('Could not detect any host');
}
if (!$this->remoteHostValidator->isValid($host)) {
throw new LocalServerException('Host violates local access rules');
throw new LocalServerException('Host "'.$host.'" violates local access rules');
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/private/Http/Client/DnsPinMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function addDnsPinning() {
foreach ($targetIps as $ip) {
if ($this->ipAddressClassifier->isLocalAddress($ip)) {
// TODO: continue with all non-local IPs?
throw new LocalServerException('Host violates local access rules');
throw new LocalServerException('Host "'.$ip.'" ('.$hostName.':'.$port.') violates local access rules');
}
$curlResolves["$hostName:$port"][] = $ip;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/Http/Client/DnsPinMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static function (RequestInterface $request, array $options) {

public function testRejectIPv4() {
$this->expectException(LocalServerException::class);
$this->expectExceptionMessage('Host violates local access rules');
$this->expectExceptionMessage('violates local access rules');

$mockHandler = new MockHandler([
static function (RequestInterface $request, array $options) {
Expand Down Expand Up @@ -334,7 +334,7 @@ static function (RequestInterface $request, array $options) {

public function testRejectIPv6() {
$this->expectException(LocalServerException::class);
$this->expectExceptionMessage('Host violates local access rules');
$this->expectExceptionMessage('violates local access rules');

$mockHandler = new MockHandler([
static function (RequestInterface $request, array $options) {
Expand Down Expand Up @@ -381,7 +381,7 @@ static function (RequestInterface $request, array $options) {

public function testRejectCanonicalName() {
$this->expectException(LocalServerException::class);
$this->expectExceptionMessage('Host violates local access rules');
$this->expectExceptionMessage('violates local access rules');

$mockHandler = new MockHandler([
static function (RequestInterface $request, array $options) {
Expand Down