diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2024-09-30 13:05:19 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2024-10-01 18:00:47 +0200 |
commit | 6be00432b75a80a246246883c5fa955ce803f3d8 (patch) | |
tree | cecf063b90e346811aad05863a6ce5c5badcdddc /tests | |
parent | 870816466f2d1adaf956a83491c0645556b0d02b (diff) | |
download | nextcloud-server-6be00432b75a80a246246883c5fa955ce803f3d8.tar.gz nextcloud-server-6be00432b75a80a246246883c5fa955ce803f3d8.zip |
chore: always execute parse_url in preventLocalAddressbug/noid/federated-addressbook-sync-without-localaddressallowed
This change should make it easier to spot wrong uses of the HTTP client on development setups where allow_local_remote_servers is usually true.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Http/Client/ClientTest.php | 8 |
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'], ]; |