[Catalyst] post - all empty?

Christopher H. Laco claco at chrislaco.com
Fri Sep 7 15:44:42 GMT 2007


Josef Chladek wrote:
> hi list,
> =

> I have a strange problem, that occurs for some clients, for most not: we
> have a form, that is setup  by javascript dynamically (form consits of
> one input field, one textarea and 2 hidden fields)
> =

> ...
> form.setAttribute('action','/cat/postings/post_comment');
> form.setAttribute('id','input_form');
> form.setAttribute('name','input_form');
> form.setAttribute('method','post');
> form.setAttribute('enctype','multipart/form-data');
> form.setAttribute('accept-charset','utf-8');
> form.setAttribute('onSubmit', 'return check(' + parent + ')');
> ...
> =

> as said, most of the time it works without a problem, but sometimes I
> get the following error:
> =

> [error] Caught exception in engine "Wrong Content-Length value: xxx at
> /usr/local/share/perl/5.8.8/Catalyst.pm line 1636"
> =

> which is thrown from Enigne.pm
> =

> # 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" );
> }
> =

> from debugging I found out, that $remaining in fact is $length, so it
> seems, that nothing was read from the post body
> =

> HTTP::Body is version 0.9, I changed multipart/form-data to
> application/x-www-form-urlencoded, still no effect.
> to see the form, you have to be logged in, which works fine, I can
> identify the user from the session, so cookie etc. working fine
> =

> any clue what could happen here?
> =

> thanks
> josef

If the Content-Length really is 0, I've found one thing over the years
that does it. Older Mozilla/Netscape versions, usually CompuServe
branded versions, would not POST and content of a form if javascript set
the forms style to display:none or hidden in CSS.

In my case, if was the usual tinkerage of hiding the form and displaying
a "Now processing" image when a user clicked the Submit button.

To this day, I still get the occasional Content-Length: 0 from these
browsers...about 5 a week.

Just a thought.

-=3DChris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070907/919b=
8e96/signature.pgp


More information about the Catalyst mailing list