X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FResponse.pm;h=818ae86c11230e82c8a1111e27af50e724d28ccd;hb=14eb7697d007e9e1b08be593846233533a880f60;hp=f268aefbee830273aaedc6d3c1859b86cb30e983;hpb=ee24f3a811ffe5b55e2645cfcb060b0fc4800cfb;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Response.pm b/lib/Catalyst/Response.pm index f268aef..818ae86 100644 --- a/lib/Catalyst/Response.pm +++ b/lib/Catalyst/Response.pm @@ -6,14 +6,9 @@ use HTTP::Headers; with 'MooseX::Emulate::Class::Accessor::Fast'; has cookies => (is => 'rw', default => sub { {} }); -has body => (is => 'rw', default => '', lazy => 1, predicate => 'has_body', - clearer => '_clear_body' -); -after 'body' => sub { # If someone assigned undef, clear the body so we get '' - if (scalar(@_) == 2 && !defined($_[1])) { - $_[0]->_clear_body; - } -}; +has body => (is => 'rw', default => undef); +sub has_body { defined($_[0]->body) } + has location => (is => 'rw'); has status => (is => 'rw', default => 200); has finalized_headers => (is => 'rw', default => 0); @@ -206,6 +201,7 @@ sub print { defined $self->write($,) or return; defined $self->write($_) or return; } + defined $self->write($\) or return; return 1; }