[Catalyst] "Wrong Content-Length value"

Nicholas Wehr catalyst at bionikchickens.com
Wed Sep 8 23:13:15 GMT 2010


okay - in this context I can understand your original message. I think
catalyst is behaving okay. In your example, the client is disconnected so it
cannot receive a response code. in my test telnet where I ran your example,
I fed more data in than was expected - but since I left the client connected
I got a response. the server went ahead and detected the content-length and
failed gracefully, though cryptically...

POST /foo HTTP/1.1
Host: localhost:3000
Content-Type: application/octet-stream
Content-Length: 4

asdfgasdfasdf
HTTP/1.0 404 Not Found
Connection: close
Date: Wed, 08 Sep 2010 23:09:47 GMT
Content-Length: 14
Content-Type: text/html; charset=3Dutf-8
Status: 404
X-Catalyst: 5.80024

Page not found


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

>
>
> On Wed, Sep 8, 2010 at 2:38 PM, Nicholas Wehr <catalyst at bionikchickens.com
> > wrote:
>
>> interesting problem. so the client is making byte-range requests on
>> dynamic content? if it's static - I'd recommend you defer this functiona=
lity
>> to apache.
>>
>
> No, it's not that.  It's simply that the client is sending a content-leng=
th
> header and after Catalyst / HTTP::Body slurps in the body Catalyst does a
> sanity check to see if the length of the body really was the length
> specified in the header.
>
> Watch:
>
> moseley at bumby2:~$ catalyst.pl Length
> moseley at bumby2:~$ CATALYST_DEBUG=3D0 Length/script/length_server.pl
> You can connect to your server at http://bumby2:3000
>
>
> moseley at bumby2:~$ telnet localhost 3000
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> POST /foo HTTP/1.1
> Host: localhost:3000
> Content-Type: application/octet-stream
> Content-Length: 400000
>
> just some stuff
> ^]
> telnet> quit
> Connection closed.
>
> Results in:
>
> [error] Caught exception in engine "Wrong Content-Length value: 400000"
>
>
>
> --
> 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/ce3a5=
0a2/attachment.htm


More information about the Catalyst mailing list