4
use Test::Nginx::Socket::Chunkin;
6
plan tests => repeat_each() * 2 * blocks();
26
=== TEST 2: good chunked body
33
Transfer-Encoding: chunked
41
--- response_body chomp
46
=== TEST 3: chunk size too small
53
Transfer-Encoding: chunked
62
--- response_body_like: 400 Bad Request
66
=== TEST 4: chunk size too big
73
Transfer-Encoding: chunked
81
--- response_body_like: 400 Bad Request
86
=== TEST 5: chunk size even bigger
93
Transfer-Encoding: chunked
101
--- response_body_like: 400 Bad Request
106
=== TEST 6: chunk size WAY too big and rejected by ragel DFA
113
Transfer-Encoding: chunked
122
--- response_body_like: 400 Bad Request
126
=== TEST 7: missing LF after data chunk
133
Transfer-Encoding: chunked
141
--- response_body_like: 400 Bad Request
145
=== TEST 8: missing CR after data chunk
152
Transfer-Encoding: chunked
161
--- response_body_like: 400 Bad Request
165
=== TEST 9: missing CRLF after data chunk
172
Transfer-Encoding: chunked
180
--- response_body_like: 400 Bad Request
184
=== TEST 10: 2 zero chunks
191
Transfer-Encoding: chunked
203
=== TEST 11: 1 00 chunk and 1 zero chunk
207
#echo "length: $http_content_length";
211
Transfer-Encoding: chunked
223
=== TEST 12: 1 00 chunk and 1 zero chunk
230
Transfer-Encoding: chunked
240
--- response_body: helloworld,hello
244
=== TEST 13: bad chunk size
251
Transfer-Encoding: chunked
259
--- response_body_like: 400 Bad Request
264
=== TEST 14: bad chunk size in the 2nd chunk
271
Transfer-Encoding: chunked
272
User-Agent: Java Browser
282
--- response_body_like: 400 Bad Request
287
=== TEST 15: error near the end of big chunks
294
Transfer-Encoding: chunked
302
--- response_body_like: 400 Bad Request