[Catalyst] "Wrong Content-Length value"

Bill Moseley moseley at hank.org
Wed Sep 8 21:08:49 GMT 2010


The problem I have with this code is that requests can trigger an error on
demand.  Errors eventually trigger an email to a bunch of people. But it's
for an error nobody can fix.

        # paranoia against wrong Content-Length header
        my $remaining =3D $length - $self->read_position;
        if ( $remaining > 0 ) {
            $self->finalize_read($c);
            Catalyst::Exception->throw(
                "Wrong Content-Length value: $length" );
        }

Shouldn't that just return 411, 413, or just a 400?

And then there's:
    eval {
      ....
    };

    if ( my $error =3D $@ ) {
        chomp $error;
        $class->log->error(qq/Caught exception in engine "$error"/);
    }

Should check return value from eval instead.



-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100908/35504=
d36/attachment.htm


More information about the Catalyst mailing list