Fix passing file GLOBs to $c->res->body
authorStefan Seifert <nine@cpan.org>
Fri, 19 Nov 2010 12:08:17 +0000 (12:08 +0000)
committerStefan Seifert <nine@cpan.org>
Fri, 19 Nov 2010 12:08:17 +0000 (12:08 +0000)
commitf397b3064091f4b9f03210d5b630cfd757534c50
treefd269682ed1cc64e0d9cae62bbc3c7e9332ca567
parentcd121560a0d1545a97dd58436e57b678841cbc0a
Fix passing file GLOBs to $c->res->body

Contrary to the documentation of Catalyst::Response, passing a
filehandle GLOB did not work, since the content-length header was not
computed correctly.

body checked if it was passed a blessed object and only then use stat
to get the file size. In all other cases the passed thing was considered
a string and length was used. Filehandle GLOBs are neither blessed nor
strings, so the content-length header always got set to 15 (length of a
stringified GLOB: "GLOB(0x123456)").
lib/Catalyst.pm
t/aggregate/live_component_controller_action_streaming.t
t/lib/TestApp/Controller/Action/Streaming.pm