| 1 | use strict; |
| 2 | use warnings; |
| 3 | use Test::More; |
| 4 | use lib 't/lib/'; |
| 5 | use t::Internal; |
| 6 | |
| 7 | my $client = t::Internal->new(path => 't/fcgi/big_post.fcgi'); |
| 8 | |
| 9 | for my $len (85_556, 1_000_000) { |
| 10 | my $chunk = "abcdefg" x $len; |
| 11 | my ( $stdout, $stderr ) = $client->request( |
| 12 | +{ |
| 13 | REQUEST_METHOD => 'GET', |
| 14 | QUERY_STRING => 'foo=bar', |
| 15 | CONTENT_TYPE => 'application/octet-stream', |
| 16 | CONTENT_LENGTH => length($chunk), |
| 17 | }, |
| 18 | $chunk, |
| 19 | 10 |
| 20 | ); |
| 21 | is $stdout, "Content−Type: application/octet-stream\r\nContent-Length: @{[ length($chunk) ]}\r\n\r\n$chunk"; |
| 22 | my ($x1, $x2) = $stderr =~ /len: (\d+), (\d+)\n/; |
| 23 | is $x1, $x2; |
| 24 | is $x1, length($chunk); |
| 25 | } |
| 26 | |
| 27 | done_testing; |