The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;
use Test::More tests => 1;
use Plack::Test;
use Plack::Request;
use Try::Tiny;

{
    try {
        my $data = 'a';
        open my $input, "<", \$data;
        my $req = Plack::Request->new({
            'psgi.input'   => $input,
            CONTENT_LENGTH => 3,
            CONTENT_TYPE   => 'application/octet-stream'
        });
        $req->body_parameters;
    } catch {
        like $_, qr/Bad Content-Length/;
    }
}