changeset 1054:9b8e13e2ee67

Tests: one more $realip_remote_addr test case on internal redirect. List the address set by realip in set_real_ip_from to catch the bug causing $realip_remote_addr overwrite fixed in cecf415643d7 (1.11.5).
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 11 Oct 2016 13:08:00 +0300
parents fbf731526f49
children 8979f0d86c29
files realip_remote_addr.t
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/realip_remote_addr.t
+++ b/realip_remote_addr.t
@@ -37,6 +37,7 @@ http {
     %%TEST_GLOBALS_HTTP%%
 
     set_real_ip_from  127.0.0.1/32;
+    set_real_ip_from  192.0.2.1/32;
     real_ip_header    X-Forwarded-For;
 
     server {
@@ -67,8 +68,14 @@ like(http_get('/1'), qr/X-Real-IP: 127.0
 like(http_get('/'), qr/X-Real-IP: 127.0.0.1/m, 'request redirect');
 
 like(http_xff('/1', '192.0.2.1'), qr/X-Real-IP: 127.0.0.1/m, 'realip');
+
+TODO: {
+local $TODO = 'not yet' unless $t->has_version('1.11.5');
+
 like(http_xff('/', '192.0.2.1'), qr/X-Real-IP: 127.0.0.1/m, 'realip redirect');
 
+}
+
 ###############################################################################
 
 sub http_xff {