aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-11-22 15:53:41 +0100
committerVincent Petry <vincent@nextcloud.com>2021-11-22 16:46:25 +0100
commitf01ad7b8d811c72ecfcc9c99207ae8acc87ed40c (patch)
tree2d979246f52ff323ac27cd9554e5880edae515b5 /tests
parent7e08a4ab157b2be82c286c65ae18fa9199aeba80 (diff)
downloadnextcloud-server-f01ad7b8d811c72ecfcc9c99207ae8acc87ed40c.tar.gz
nextcloud-server-f01ad7b8d811c72ecfcc9c99207ae8acc87ed40c.zip
Improve normalizer detecting IPv4 inside of IPv6
The subnet for an IPv4 address inside of IPv6 is now returned in its IPv4 form. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Security/Normalizer/IpAddressTest.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/lib/Security/Normalizer/IpAddressTest.php b/tests/lib/Security/Normalizer/IpAddressTest.php
index 7492e182c32..bb487659ced 100644
--- a/tests/lib/Security/Normalizer/IpAddressTest.php
+++ b/tests/lib/Security/Normalizer/IpAddressTest.php
@@ -40,7 +40,15 @@ class IpAddressTest extends TestCase {
],
[
'::ffff:192.168.0.123',
- '::ffff:192.168.0.123/32',
+ '192.168.0.123/32',
+ ],
+ [
+ '0:0:0:0:0:ffff:192.168.0.123',
+ '192.168.0.123/32',
+ ],
+ [
+ '0:0:0:0:0:ffff:c0a8:7b',
+ '192.168.0.123/32',
],
[
'2001:0db8:85a3:0000:0000:8a2e:0370:7334',