4
use Test::Nginx::LWP::Chunkin;
6
plan tests => repeat_each() * 2 * blocks();
14
=== TEST 1: many little chunks
18
client_body_buffer_size 4;
25
"hello world blah blah blah! oh, yay! end"]
26
--- response_body eval
27
"hello world blah blah blah! oh, yay! end"
31
=== TEST 2: many little chunks (more!)
35
client_body_buffer_size 1k;
43
("hello world blah blah blah! o, yah!" x 4) . 'end']
44
--- response_body eval
45
("hello world blah blah blah! o, yah!" x 4) . 'end'
49
=== TEST 3: many little chunks (more!)
53
client_body_buffer_size 60;
61
("hello world blah blah blah! oh, yah!" x 100) . 'end']
62
--- response_body eval
63
("hello world blah blah blah! oh, yah!" x 100) . 'end'
67
=== TEST 4: exceeding max body limit (this test may fail randomly with the error "500 write failed: Connection reset by peer", which is considered OK).
71
client_body_buffer_size 512;
72
client_max_body_size 1024;
81
--- response_body_like: 413 Request Entity Too Large
86
=== TEST 5: not exceeding max body limit (chunk spanning preread and rb->buf)
90
client_body_buffer_size 512;
91
client_max_body_size 1048;
99
--- response_body eval
104
=== TEST 6: next chunk reset bug
108
client_body_buffer_size 600;
109
client_max_body_size 8k;
115
--- middle_chunk_delay: 0.001
116
--- chunked_body eval
119
--- response_body eval
124
=== TEST 7: next chunk reset bug (too many chunks)
128
client_body_buffer_size 8k;
129
client_max_body_size 8k;
135
--- chunked_body eval
138
--- response_body eval
143
=== TEST 8: normal POST with chunkin on
147
client_body_buffer_size 600;
148
client_max_body_size 8k;
150
echo_read_request_body;
156
--- response_body chomp
161
=== TEST 9: not exceeding max body limit (chunk spanning preread and rb->buf)
165
client_body_buffer_size 10m;
166
client_max_body_size 10m;
173
--- chunked_body eval
174
[split //, "a" x (500 * 1024)]
175
--- middle_chunk_delay: 0
176
--- response_body eval