From 939f6663e9e9215ddb314cc09fa42219a3d552bf Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 10 May 2021 23:33:19 +0000 Subject: [PATCH] Bug 28200: [Alternate] Remove unit test using abbreviated format This patch removes the unit test that uses the abbreviated format, since it's not supported in newer versions of Net::Netmask without a workaround. Test plan: 0. Set up Koha dev environment on Debian 11 1. perl t/Koha/Middleware/RealIP.t 2. Tests should pass --- t/Koha/Middleware/RealIP.t | 6 ------ 1 file changed, 6 deletions(-) diff --git a/t/Koha/Middleware/RealIP.t b/t/Koha/Middleware/RealIP.t index c60994b189..7124a01f95 100755 --- a/t/Koha/Middleware/RealIP.t +++ b/t/Koha/Middleware/RealIP.t @@ -109,12 +109,6 @@ subtest "Test alternative configuration styles" => sub { $remote_address = "2.2.2.2"; $x_forwarded_for_header = "1.1.1.1"; - t::lib::Mocks::mock_config('koha_trusted_proxies', '2.2.2'); - $address = Koha::Middleware::RealIP::get_real_ip( $remote_address, $x_forwarded_for_header ); - is($address,'1.1.1.1',"Trust proxy (2.2.2.2) using abbreviated notation, so use the X-Forwarded-For header for the remote address"); - - $remote_address = "2.2.2.2"; - $x_forwarded_for_header = "1.1.1.1"; t::lib::Mocks::mock_config('koha_trusted_proxies', '2.2.2.0:255.255.255.0'); $address = Koha::Middleware::RealIP::get_real_ip( $remote_address, $x_forwarded_for_header ); is($address,'1.1.1.1',"Trust proxy (2.2.2.2) using an IP address and netmask separated by a colon, so use the X-Forwarded-For header for the remote address"); -- 2.11.0