mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 18:52:53 -04:00
Merge pull request #43650 from Commifreak/log_host_ip_for_access_violation
This commit is contained in:
commit
e79d42604d
3 changed files with 5 additions and 5 deletions
|
|
@ -192,7 +192,7 @@ class Client implements IClient {
|
|||
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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class DnsPinMiddleware {
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ class DnsPinMiddlewareTest extends TestCase {
|
|||
|
||||
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) {
|
||||
|
|
@ -334,7 +334,7 @@ class DnsPinMiddlewareTest extends TestCase {
|
|||
|
||||
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) {
|
||||
|
|
@ -381,7 +381,7 @@ class DnsPinMiddlewareTest extends TestCase {
|
|||
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue