Tests: added realip test on http post read phase.
diff --git a/realip.t b/realip.t
index 9cfb3d8..50129d6 100644
--- a/realip.t
+++ b/realip.t
@@ -21,7 +21,7 @@
select STDERR; $| = 1;
select STDOUT; $| = 1;
-my $t = Test::Nginx->new()->has(qw/http realip/);
+my $t = Test::Nginx->new()->has(qw/http realip rewrite/);
$t->write_file_expand('nginx.conf', <<'EOF');
@@ -41,8 +41,13 @@
server {
listen 127.0.0.1:8080;
+ listen 127.0.0.1:8081;
server_name localhost;
+ if ($server_port = 8081) {
+ return 204;
+ }
+
location / { }
location /custom {
real_ip_header X-Real-IP-Custom;
@@ -71,7 +76,7 @@
plan(skip_all => 'no 127.0.0.1 on host')
if http_get('/') !~ /X-IP: 127.0.0.1/m;
-$t->plan(7);
+$t->plan(8);
###############################################################################
@@ -113,6 +118,14 @@
EOF
+my $s = IO::Socket::INET->new('127.0.0.1:' . port(8081));
+like(http(<<EOF, socket => $s), qr/ 204 .*192.0.2.1/s, 'realip post read');
+GET / HTTP/1.0
+Host: localhost
+X-Real-IP: 192.0.2.1
+
+EOF
+
###############################################################################
sub http_xff {