aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Http/Client/ClientTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Http/Client/ClientTest.php')
-rw-r--r--tests/lib/Http/Client/ClientTest.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php
index 237bb1299e5..47a6b885aed 100644
--- a/tests/lib/Http/Client/ClientTest.php
+++ b/tests/lib/Http/Client/ClientTest.php
@@ -130,6 +130,13 @@ class ClientTest extends \Test\TestCase {
], self::invokePrivate($this->client, 'getProxyUri'));
}
+ public function testPreventLocalAddressThrowOnInvalidUri(): void {
+ $this->expectException(LocalServerException::class);
+ $this->expectExceptionMessage('Could not detect any host');
+
+ self::invokePrivate($this->client, 'preventLocalAddress', ['!@#$', []]);
+ }
+
public function dataPreventLocalAddress():array {
return [
['https://localhost/foo.bar'],
@@ -146,7 +153,6 @@ class ClientTest extends \Test\TestCase {
['https://10.0.0.1'],
['https://another-host.local'],
['https://service.localhost'],
- ['!@#$', true], // test invalid url
['https://normal.host.com'],
['https://com.one-.nextcloud-one.com'],
];