X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FRequest.pm;h=f0b26ffd36e254c3a0ddff62bc6f6029de13853a;hb=8f58057d45b3caf4f025985390f1faaa61302851;hp=85c4941c790315854625befd580e4e72c39ceca9;hpb=069355dabccdbb5fd15a4c7cabd7ef3b96963182;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 85c4941..f0b26ff 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -64,7 +64,6 @@ before body_parameters => sub { has uploads => ( is => 'rw', required => 1, - lazy => 1, default => sub { {} }, ); @@ -97,14 +96,16 @@ has base => ( ); has _body => ( - is => 'rw', - accessor => 'body', + is => 'rw', clearer => '_clear_body', predicate => '_has_body', ); - -before body => sub { - my ($self) = @_; +# Eugh, ugly. Should just be able to rename accessor methods to 'body' +# and provide a custom reader.. +sub body { + my $self = shift; $self->_context->prepare_body(); -}; + $self->_body(@_) if scalar @_; + return blessed $self->_body ? $self->_body->body : $self->_body; +} has hostname => ( is => 'rw', @@ -209,6 +210,9 @@ For example, if your action was and the URI for the request was C, the string C would be the first and only argument. +Arguments just get passed through and B get unescaped automatically, so +you should do that explicitly. + =head2 $req->args Shortcut for arguments. @@ -398,7 +402,7 @@ Returns the path, i.e. the part of the URI after $req->base, for the current req =head2 $req->path_info -Alias for path, added for compability with L. +Alias for path, added for compatibility with L. =cut @@ -462,7 +466,7 @@ actions or regex captures. =head2 $req->snippets -C used to be called snippets. This is still available for backwoards +C used to be called snippets. This is still available for backwards compatibility, but is considered deprecated. =head2 $req->upload