changeset 252:8b554d26eb1a

Tests: client_body_in_file_only with proxy test.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 28 Jan 2013 15:25:28 +0400
parents df984d23f9d1
children f440a8acbf39 cca7b57587d6
files body.t
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/body.t
+++ b/body.t
@@ -22,7 +22,7 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(10);
+my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(11);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -55,6 +55,10 @@ http {
             add_header X-Body-File "$request_body_file";
             proxy_pass http://127.0.0.1:8081;
         }
+        location /small {
+            client_body_in_file_only on;
+            proxy_pass http://127.0.0.1:8080/;
+        }
         location /single {
             client_body_in_single_buffer on;
             add_header X-Body "$request_body";
@@ -113,6 +117,16 @@ like(http_get_body('/discard', '01234567
 	'0123456789', 'foobar'), qr/(TEST.*){4}/ms,
 	'body discard 2');
 
+TODO: {
+local $TODO = 'broken by 1.3.9';
+
+# proxy with file only
+
+like(http_get_body('/small', '0123456789'),
+	qr/X-Body: 0123456789\x0d?$/ms, 'small body in file only');
+
+}
+
 ###############################################################################
 
 sub read_body_file {