View | Details | Raw Unified | Return to bug 28200
Collapse All | Expand All

(-)a/t/Koha/Middleware/RealIP.t (-7 lines)
Lines 109-120 subtest "Test alternative configuration styles" => sub { Link Here
109
109
110
    $remote_address = "2.2.2.2";
110
    $remote_address = "2.2.2.2";
111
    $x_forwarded_for_header = "1.1.1.1";
111
    $x_forwarded_for_header = "1.1.1.1";
112
    t::lib::Mocks::mock_config('koha_trusted_proxies', '2.2.2');
113
    $address = Koha::Middleware::RealIP::get_real_ip( $remote_address, $x_forwarded_for_header );
114
    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");
115
116
    $remote_address = "2.2.2.2";
117
    $x_forwarded_for_header = "1.1.1.1";
118
    t::lib::Mocks::mock_config('koha_trusted_proxies', '2.2.2.0:255.255.255.0');
112
    t::lib::Mocks::mock_config('koha_trusted_proxies', '2.2.2.0:255.255.255.0');
119
    $address = Koha::Middleware::RealIP::get_real_ip( $remote_address, $x_forwarded_for_header );
113
    $address = Koha::Middleware::RealIP::get_real_ip( $remote_address, $x_forwarded_for_header );
120
    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");
114
    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");
121
- 

Return to bug 28200