[Catalyst] "Wrong Content-Length value"

Nicholas Wehr catalyst at bionikchickens.com
Wed Sep 8 21:16:46 GMT 2010


so which engine and version are you using? apache? built-in http? fastcgi?

On Wed, Sep 8, 2010 at 2:08 PM, Bill Moseley <moseley at hank.org> wrote:

> 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
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100908/88887=
a98/attachment.htm


More information about the Catalyst mailing list