Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-10-27 16:57:58 +0300
committerGitHub <noreply@github.com>2022-10-27 16:57:58 +0300
commitd007088cf5d89e29065991e0cbe2c890dfa13d96 (patch)
tree20b5029fbf1909a0d63a553ad686c45b57842afe
parent5b77675ee90e75f5796521ef633d1675ac9bd149 (diff)
parentd4b9b010b0cb753a86af63cb917020e790555036 (diff)
Merge pull request #34847 from nextcloud/refactor/local-address-checker-method-capitalization
Rename LocalAddressChecker methods to lower case
-rw-r--r--lib/private/Http/Client/Client.php2
-rw-r--r--lib/private/Http/Client/DnsPinMiddleware.php2
-rw-r--r--lib/private/Http/Client/LocalAddressChecker.php6
-rw-r--r--tests/lib/Http/Client/ClientTest.php10
-rw-r--r--tests/lib/Http/Client/LocalAddressCheckerTest.php8
5 files changed, 14 insertions, 14 deletions
diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php
index 4bf7fd02400..d4dba3e5a44 100644
--- a/lib/private/Http/Client/Client.php
+++ b/lib/private/Http/Client/Client.php
@@ -181,7 +181,7 @@ class Client implements IClient {
return;
}
- $this->localAddressChecker->ThrowIfLocalAddress($uri);
+ $this->localAddressChecker->throwIfLocalAddress($uri);
}
/**
diff --git a/lib/private/Http/Client/DnsPinMiddleware.php b/lib/private/Http/Client/DnsPinMiddleware.php
index f5e6214a4ab..00bc209d7b1 100644
--- a/lib/private/Http/Client/DnsPinMiddleware.php
+++ b/lib/private/Http/Client/DnsPinMiddleware.php
@@ -133,7 +133,7 @@ class DnsPinMiddleware {
$curlResolves["$hostName:$port"] = [];
foreach ($targetIps as $ip) {
- $this->localAddressChecker->ThrowIfLocalIp($ip);
+ $this->localAddressChecker->throwIfLocalIp($ip);
$curlResolves["$hostName:$port"][] = $ip;
}
}
diff --git a/lib/private/Http/Client/LocalAddressChecker.php b/lib/private/Http/Client/LocalAddressChecker.php
index 13a7d062de3..eb24f002d7d 100644
--- a/lib/private/Http/Client/LocalAddressChecker.php
+++ b/lib/private/Http/Client/LocalAddressChecker.php
@@ -39,7 +39,7 @@ class LocalAddressChecker {
$this->logger = $logger;
}
- public function ThrowIfLocalIp(string $ip) : void {
+ public function throwIfLocalIp(string $ip) : void {
$parsedIp = Factory::parseAddressString(
$ip,
ParseStringFlag::IPV4_MAYBE_NON_DECIMAL | ParseStringFlag::IPV4ADDRESS_MAYBE_NON_QUAD_DOTTED
@@ -70,7 +70,7 @@ class LocalAddressChecker {
}
}
- public function ThrowIfLocalAddress(string $uri) : void {
+ public function throwIfLocalAddress(string $uri) : void {
$host = parse_url($uri, PHP_URL_HOST);
if ($host === false || $host === null) {
$this->logger->warning("Could not detect any host in $uri");
@@ -97,6 +97,6 @@ class LocalAddressChecker {
throw new LocalServerException('Host violates local access rules');
}
- $this->ThrowIfLocalIp($host);
+ $this->throwIfLocalIp($host);
}
}
diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php
index 25d4749df57..fa2374aeb7e 100644
--- a/tests/lib/Http/Client/ClientTest.php
+++ b/tests/lib/Http/Client/ClientTest.php
@@ -203,7 +203,7 @@ class ClientTest extends \Test\TestCase {
$this->expectException(LocalServerException::class);
$this->localAddressChecker
->expects($this->once())
- ->method('ThrowIfLocalAddress')
+ ->method('throwIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
@@ -218,7 +218,7 @@ class ClientTest extends \Test\TestCase {
$this->expectException(LocalServerException::class);
$this->localAddressChecker
->expects($this->once())
- ->method('ThrowIfLocalAddress')
+ ->method('throwIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
@@ -233,7 +233,7 @@ class ClientTest extends \Test\TestCase {
$this->expectException(LocalServerException::class);
$this->localAddressChecker
->expects($this->once())
- ->method('ThrowIfLocalAddress')
+ ->method('throwIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
@@ -248,7 +248,7 @@ class ClientTest extends \Test\TestCase {
$this->expectException(LocalServerException::class);
$this->localAddressChecker
->expects($this->once())
- ->method('ThrowIfLocalAddress')
+ ->method('throwIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
@@ -263,7 +263,7 @@ class ClientTest extends \Test\TestCase {
$this->expectException(LocalServerException::class);
$this->localAddressChecker
->expects($this->once())
- ->method('ThrowIfLocalAddress')
+ ->method('throwIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
diff --git a/tests/lib/Http/Client/LocalAddressCheckerTest.php b/tests/lib/Http/Client/LocalAddressCheckerTest.php
index 8c8e64eddf9..024c52b3705 100644
--- a/tests/lib/Http/Client/LocalAddressCheckerTest.php
+++ b/tests/lib/Http/Client/LocalAddressCheckerTest.php
@@ -47,7 +47,7 @@ class LocalAddressCheckerTest extends \Test\TestCase {
*/
public function testThrowIfLocalAddress($uri) : void {
$this->expectException(LocalServerException::class);
- $this->localAddressChecker->ThrowIfLocalAddress('http://' . $uri);
+ $this->localAddressChecker->throwIfLocalAddress('http://' . $uri);
}
/**
@@ -55,7 +55,7 @@ class LocalAddressCheckerTest extends \Test\TestCase {
* @param string $uri
*/
public function testThrowIfLocalAddressGood($uri) : void {
- $this->localAddressChecker->ThrowIfLocalAddress('http://' . $uri);
+ $this->localAddressChecker->throwIfLocalAddress('http://' . $uri);
$this->assertTrue(true);
}
@@ -66,7 +66,7 @@ class LocalAddressCheckerTest extends \Test\TestCase {
*/
public function testThrowIfLocalIpBad($ip) : void {
$this->expectException(LocalServerException::class);
- $this->localAddressChecker->ThrowIfLocalIp($ip);
+ $this->localAddressChecker->throwIfLocalIp($ip);
}
/**
@@ -74,7 +74,7 @@ class LocalAddressCheckerTest extends \Test\TestCase {
* @param string $ip
*/
public function testThrowIfLocalIpGood($ip) : void {
- $this->localAddressChecker->ThrowIfLocalIp($ip);
+ $this->localAddressChecker->throwIfLocalIp($ip);
$this->assertTrue(true);
}