[Catalyst] How to send raw HTTP response

Wade.Stuart at fallon.com Wade.Stuart at fallon.com
Thu Sep 25 23:20:00 BST 2008


Tomas Doran <bobtfish at bobtfish.net> wrote on 09/25/2008 04:04:58 PM:

>
> On 25 Sep 2008, at 19:35, Christian Lackas wrote:
> >
> >     print CGI::header(...);
> >     $ZIP->writeToFileHandle(*STDOUT);
> >     for my $f (@files) {
> >         $ZIP->addFile($f, basename($f));
> >     }
> >
> > How can I achieve something similar under Catalyst?
>
> Looking at the source code for Catalyst::write, and
> Catalyst::Engine::write, you need to say $c->finalize_headers, after
> which just writing to STDOUT as above should do the right thing..
>
> However, I'd have thought that clients on the other end would be
> somewhat unhappy with not getting a Content-Length header...

The only two consequences I know of for not including the content length is
that the download bar for the transfer lists unknown in browsers, and if
the transfer fails midway the browser does not "know".

-Wade




More information about the Catalyst mailing list