with 'MooseX::Emulate::Class::Accessor::Fast';
-has env => (is => 'ro', writer => '_set_env', predicate => 'has_env');
+has env => (is => 'ro', writer => '_set_env', predicate => '_has_env');
# XXX Deprecated crap here - warn?
has action => (is => 'rw');
# XXX: Deprecated in docs ages ago (2006), deprecated with warning in 5.8000 due
# If previously applied middleware created the HTTP::Body object, then we
# just use that one.
- if(my $plack_body = $self->env->{'plack.request.http.body'}) {
+ if(my $plack_body = $self->_has_env ? $self->env->{'plack.request.http.body'} : undef) {
$self->_body($plack_body);
$self->_body->cleanup(1);
return;