diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-09-22 11:38:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-22 11:38:12 +0200 |
commit | 2f15e83d7beea8df2f03eeb66c7dee45aed033ee (patch) | |
tree | b7e4e5401305ebaef74deb78511a33746546509b /tests/lib | |
parent | 938bc57f6dd0d4e6f152692926856263dacc06dd (diff) | |
parent | 75328593ad06cea7b3b0331dec999e6f5a083ef1 (diff) | |
download | nextcloud-server-2f15e83d7beea8df2f03eeb66c7dee45aed033ee.tar.gz nextcloud-server-2f15e83d7beea8df2f03eeb66c7dee45aed033ee.zip |
Merge pull request #34160 from nextcloud/fix/detect-weird-local-ips
Detect weird local ips
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Http/Client/ClientTest.php | 1 | ||||
-rw-r--r-- | tests/lib/Http/Client/LocalAddressCheckerTest.php | 23 |
2 files changed, 22 insertions, 2 deletions
diff --git a/tests/lib/Http/Client/ClientTest.php b/tests/lib/Http/Client/ClientTest.php index 141c6190cd9..25d4749df57 100644 --- a/tests/lib/Http/Client/ClientTest.php +++ b/tests/lib/Http/Client/ClientTest.php @@ -161,6 +161,7 @@ class ClientTest extends \Test\TestCase { ['another-host.local'], ['service.localhost'], ['!@#$'], // test invalid url + ['normal.host.com'], ]; } diff --git a/tests/lib/Http/Client/LocalAddressCheckerTest.php b/tests/lib/Http/Client/LocalAddressCheckerTest.php index 9f2f6c72993..8c8e64eddf9 100644 --- a/tests/lib/Http/Client/LocalAddressCheckerTest.php +++ b/tests/lib/Http/Client/LocalAddressCheckerTest.php @@ -91,7 +91,7 @@ class LocalAddressCheckerTest extends \Test\TestCase { return [ ['192.168.0.1'], ['fe80::200:5aee:feaa:20a2'], - ['0:0:0:0:0:0:10.0.0.1'], + ['0:0:0:0:0:ffff:10.0.0.1'], ['0:0:0:0:0:ffff:127.0.0.0'], ['10.0.0.1'], ['::'], @@ -112,7 +112,7 @@ class LocalAddressCheckerTest extends \Test\TestCase { ['172.16.42.1'], ['[fdf8:f53b:82e4::53]/secret.ics'], ['[fe80::200:5aee:feaa:20a2]/secret.ics'], - ['[0:0:0:0:0:0:10.0.0.1]/secret.ics'], + ['[0:0:0:0:0:ffff:10.0.0.1]/secret.ics'], ['[0:0:0:0:0:ffff:127.0.0.0]/secret.ics'], ['10.0.0.1'], ['another-host.local'], @@ -121,6 +121,25 @@ class LocalAddressCheckerTest extends \Test\TestCase { ['100.100.100.200'], ['192.0.0.1'], ['randomdomain.internal'], + ['0177.0.0.9'], + ['⑯⑨。②⑤④。⑯⑨。②⑤④'], + ['127。②⑤④。⑯⑨.②⑤④'], + ['127.0.00000000000000000000000000000000001'], + ['127.1'], + ['127.000.001'], + ['0177.0.0.01'], + ['0x7f.0x0.0x0.0x1'], + ['0x7f000001'], + ['2130706433'], + ['00000000000000000000000000000000000000000000000000177.1'], + ['0x7f.1'], + ['127.0x1'], + ['[0000:0000:0000:0000:0000:0000:0000:0001]'], + ['[0:0:0:0:0:0:0:1]'], + ['[0:0:0:0::0:0:1]'], + ['%31%32%37%2E%30%2E%30%2E%31'], + ['%31%32%37%2E%30%2E%30.%31'], + ['[%3A%3A%31]'], ]; } |