From bd5329b1a5d9c97eaa2239e24f23085d053ba6ea Mon Sep 17 00:00:00 2001 From: Stevani Andolo Date: Wed, 31 May 2023 09:22:34 +0800 Subject: [PATCH] MDL-78215 core: Added support unit test --- lib/tests/curl_security_helper_test.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/tests/curl_security_helper_test.php b/lib/tests/curl_security_helper_test.php index 3d5343fb31f..aa88abd7e99 100644 --- a/lib/tests/curl_security_helper_test.php +++ b/lib/tests/curl_security_helper_test.php @@ -135,6 +135,11 @@ class curl_security_helper_test extends \advanced_testcase { // Test when DNS resolution fails. [[], "http://example.com", "127.0.0.1", "", true], + // Test ensures that the default value of getremoteaddr() 0.0.0.0 will check against the provided blocked list. + [$simpledns, "http://0.0.0.0/x.png", "0.0.0.0", "", true], + // Test set using IPV4 with integer format. + [$simpledns, "http://2852039166/x.png", "169.254.169.254", "", true], + // Test some freaky deaky Unicode domains. Should be blocked always. [$simpledns, "http://169。254。169。254/", "127.0.0.1", "", true], [$simpledns, "http://169。254。169。254/", "1.2.3.4", "", true],