Skip to content

Commit 0502e76

Browse files
hongj-srcmeta-codesync[bot]
authored andcommitted
Fix unit test for reserved prefixed
Summary: Github CI action failed: https://github.com/facebook/capi-param-builder/actions/runs/21370508022/job/61516057214 With investigation, seems 2001:db8::/32 prefix is reserved for IPv6 documentation prefix within [RFC3849](https://datatracker.ietf.org/doc/html/rfc3849). It should treat as a non-public IP. However, this is a PHP bug. Th bug got fixed finally [patch](https://bugs.php.net/bug.php?id=61700#:~:text=History&text=The%20FILTER_FLAG_NO_RES_RANGE%20flag%20only%20works,nothing%20is%20done%20with%20it?&text=Hellon%20The%20problem%20is%20still,Thanks.). It got refactorred and released in 8.4.3([here](php/php-src#16944)). For pre-8.4.3 may carry over this bug. For our use case, we want to valid and test a real public IP. Change the test case to a general public ipv6 ip. Differential Revision: D91510128 fbshipit-source-id: a3f9d9f890ebb914ce374ad9ca875ad2bb49eb84
1 parent e88754f commit 0502e76

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

php/capi-param-builder/tests/GetClientIpTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ public function testGetClientIpIPv6PublicPrioritization()
116116
$this->assertEquals(self::IPV6_PUBLIC . '.' . $this->appendix_no_change, $result);
117117

118118
// IPv6 public from cookie should beat IPv6 public from request (cookie priority)
119-
// Since request has a public IP, use APPENDIX_MODIFIED_NEW
120-
$anotherIPv6Public = '2001:db8::1';
119+
// Cloudflare DNS as public IP, use APPENDIX_MODIFIED_NEW
120+
$anotherIPv6Public = '2606:4700:4700::1111';
121121
$result = $this->invokePrivateStaticMethod(
122122
'getClientIp',
123123
[FBI_NAME => self::IPV6_PUBLIC],

0 commit comments

Comments
 (0)