comparison body_chunked.t @ 1711:6c03c329ed95

Tests: requests with both Content-Length and Transfer-Encoding.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 29 Jun 2021 11:57:39 +0300
parents 5ac6efbe5552
children 122002b19416
comparison
equal deleted inserted replaced
1710:f3de5730bc06 1711:6c03c329ed95
20 ############################################################################### 20 ###############################################################################
21 21
22 select STDERR; $| = 1; 22 select STDERR; $| = 1;
23 select STDOUT; $| = 1; 23 select STDOUT; $| = 1;
24 24
25 my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(16); 25 my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(17);
26 26
27 $t->write_file_expand('nginx.conf', <<'EOF'); 27 $t->write_file_expand('nginx.conf', <<'EOF');
28 28
29 %%TEST_GLOBALS%% 29 %%TEST_GLOBALS%%
30 30
175 like(http_transfer_encoding("chunked\nTransfer-Encoding: chunked"), 175 like(http_transfer_encoding("chunked\nTransfer-Encoding: chunked"),
176 qr/400 Bad/, 'transfer encoding repeat'); 176 qr/400 Bad/, 'transfer encoding repeat');
177 177
178 like(http_transfer_encoding('chunked, identity'), qr/501 Not Implemented/, 178 like(http_transfer_encoding('chunked, identity'), qr/501 Not Implemented/,
179 'transfer encoding list'); 179 'transfer encoding list');
180
181 TODO: {
182 local $TODO = 'not yet' unless $t->has_version('1.21.1');
183
184 like(http_transfer_encoding("chunked\nContent-Length: 5"), qr/400 Bad/,
185 'transfer encoding with content-length');
186
187 }
180 188
181 ############################################################################### 189 ###############################################################################
182 190
183 sub read_body_file { 191 sub read_body_file {
184 my ($r) = @_; 192 my ($r) = @_;