FAQ
Hi.


Here is a tiny patch for Catalyst::Plugin::DefaultEnd that makes
setting $c->response->body to '0' (or '000000') work as expected.


--- DefaultEnd.pm.orig 2006-03-01 15:37:37.000000000 +0100
+++ DefaultEnd.pm 2006-03-01 15:42:46.000000000 +0100
@@ -38,7 +38,7 @@
my ( $self, $c ) = @_;
die "forced debug" if $c->debug && $c->req->params->{dump_info};
return 1 if $c->response->status =~ /^3\d\d$/;
- return 1 if $c->response->body;
+ return 1 if length $c->response->body;
unless ( $c->response->content_type ) {
$c->response->content_type('text/html; charset=utf-8');
}


Best regards,

Adam

--
Adam Sj?gren
adsj at novozymes.com

Search Discussions

  • Ryan lauterbach at Apr 7, 2006 at 1:23 pm

    ADSJ (Adam Sj?gren) wrote:
    - return 1 if $c->response->body;
    + return 1 if length $c->response->body;
    unless ( $c->response->content_type ) {
    should it return true for the case of the empty string? If so maybe

    return 1 if defined $c->response->body;
  • Carl Franks at Apr 7, 2006 at 1:30 pm

    On 07/04/06, ADSJ (Adam Sj?gren) wrote:

    - return 1 if $c->response->body;
    + return 1 if length $c->response->body;
    That'll cause a warning whenever body is undefined.

    It should probably be:

    return 1 if defined $c->response->body && length $c->response->body;

    Cheers,
    Carl
  • Adam Sjøgren at Jun 21, 2006 at 8:46 am

    On Fri, 7 Apr 2006 14:30:34 +0100, Carl wrote:
    On 07/04/06, ADSJ (Adam Sj?gren) wrote:
    - return 1 if $c->response->body;
    + return 1 if length $c->response->body;
    That'll cause a warning whenever body is undefined.
    I didn't see any warnings when I tried it, but that should not stand
    in our way, so please find attached a patch, updated as you suggested,
    and I have included a test as well.


    Best regards & thanks,

    Adam

    --
    Adam Sj?gren
    adsj at novozymes.com
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: zero_body.patch
    Type: text/x-patch
    Size: 2974 bytes
    Desc: not available
    Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060621/69bd93fd/attachment.bin

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedApr 7, '06 at 12:44p
activeJun 21, '06 at 8:46a
posts4
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase