1 package Catalyst::Request;
3 use IO::Socket qw[AF_INET inet_aton];
14 use Catalyst::Exception;
17 use namespace::clean -except => 'meta';
19 with 'MooseX::Emulate::Class::Accessor::Fast';
21 has env => (is => 'ro', writer => '_set_env', predicate => '_has_env');
22 # XXX Deprecated crap here - warn?
23 has action => (is => 'rw');
24 # XXX: Deprecated in docs ages ago (2006), deprecated with warning in 5.8000 due
25 # to confusion between Engines and Plugin::Authentication. Remove in 5.8100?
26 has user => (is => 'rw');
27 sub snippets { shift->captures(@_) }
29 has _read_position => (
30 # FIXME: work around Moose bug RT#75367
33 writer => '_set_read_position',
37 # FIXME: work around Moose bug RT#75367
42 $self->header('Content-Length') || 0;
47 has address => (is => 'rw');
48 has arguments => (is => 'rw', default => sub { [] });
49 has cookies => (is => 'ro', builder => 'prepare_cookies', lazy => 1);
54 if ( my $header = $self->header('Cookie') ) {
55 return { CGI::Simple::Cookie->parse($header) };
60 has query_keywords => (is => 'rw');
61 has match => (is => 'rw');
62 has method => (is => 'rw');
63 has protocol => (is => 'rw');
64 has query_parameters => (is => 'rw', lazy=>1, default => sub { shift->_use_hash_multivalue ? Hash::MultiValue->new : +{} });
65 has secure => (is => 'rw', default => 0);
66 has captures => (is => 'rw', default => sub { [] });
67 has uri => (is => 'rw', predicate => 'has_uri');
68 has remote_user => (is => 'rw');
71 isa => 'HTTP::Headers',
72 handles => [qw(content_encoding content_length content_type header referer user_agent)],
73 builder => 'prepare_headers',
81 my $headers = HTTP::Headers->new();
83 for my $header (keys %{ $env }) {
84 next unless $header =~ /^(HTTP|CONTENT|COOKIE)/i;
85 (my $field = $header) =~ s/^HTTPS?_//;
87 $headers->header($field => $env->{$header});
100 predicate=>'_has_io_fh',
102 builder=>'_build_io_fh');
106 return $self->env->{'psgix.io'}
108 $self->env->{'net.async.http.server.req'} &&
109 $self->env->{'net.async.http.server.req'}->stream) ## Until I can make ioasync cabal see the value of supportin psgix.io (jnap)
110 || die "Your Server does not support psgix.io";
113 has data_handlers => ( is=>'ro', isa=>'HashRef', default=>sub { +{} } );
118 builder=>'_build_body_data');
120 sub _build_body_data {
123 # Not sure if these returns should not be exceptions...
124 my $content_type = $self->content_type || return;
125 return unless ($self->method eq 'POST' || $self->method eq 'PUT');
127 my ($match) = grep { $content_type =~/$_/i }
128 keys(%{$self->data_handlers});
131 my $fh = $self->body;
133 return $self->data_handlers->{$match}->($fh, $self);
135 Catalyst::Exception->throw("$content_type is does not have an available data handler");
139 has _use_hash_multivalue => (
144 # Amount of data to read from input on each pass
145 our $CHUNKSIZE = 64 * 1024;
148 my ($self, $maxlength) = @_;
149 my $remaining = $self->_read_length - $self->_read_position;
150 $maxlength ||= $CHUNKSIZE;
152 # Are we done reading?
153 if ( $remaining <= 0 ) {
157 my $readlen = ( $remaining > $maxlength ) ? $maxlength : $remaining;
158 my $rc = $self->read_chunk( my $buffer, $readlen );
160 if (0 == $rc) { # Nothing more to read even though Content-Length
161 # said there should be.
164 $self->_set_read_position( $self->_read_position + $rc );
168 Catalyst::Exception->throw(
169 message => "Unknown error reading input: $!" );
175 return $self->env->{'psgi.input'}->read(@_);
178 has body_parameters => (
182 builder => 'prepare_body_parameters',
188 default => sub { {} },
194 builder => '_build_parameters',
195 clearer => '_clear_parameters',
199 # - Can we lose the before modifiers which just call prepare_body ?
200 # they are wasteful, slow us down and feel cluttery.
202 # Can we make _body an attribute, have the rest of
203 # these lazy build from there and kill all the direct hash access
204 # in Catalyst.pm and Engine.pm?
206 sub prepare_parameters {
208 $self->_clear_parameters;
209 return $self->parameters;
212 sub _build_parameters {
215 my $body_parameters = $self->body_parameters;
216 my $query_parameters = $self->query_parameters;
218 if($self->_use_hash_multivalue) {
219 return Hash::MultiValue->new($query_parameters->flatten, $body_parameters->flatten);
222 # We copy, no references
223 foreach my $name (keys %$query_parameters) {
224 my $param = $query_parameters->{$name};
225 $parameters->{$name} = ref $param eq 'ARRAY' ? [ @$param ] : $param;
228 # Merge query and body parameters
229 foreach my $name (keys %$body_parameters) {
230 my $param = $body_parameters->{$name};
231 my @values = ref $param eq 'ARRAY' ? @$param : ($param);
232 if ( my $existing = $parameters->{$name} ) {
233 unshift(@values, (ref $existing eq 'ARRAY' ? @$existing : $existing));
235 $parameters->{$name} = @values > 1 ? \@values : $values[0];
242 predicate => '_has_uploadtmp',
248 # If previously applied middleware created the HTTP::Body object, then we
251 if(my $plack_body = $self->_has_env ? $self->env->{'plack.request.http.body'} : undef) {
252 $self->_body($plack_body);
253 $self->_body->cleanup(1);
257 # If there is nothing to read, set body to naught and return. This
258 # will cause all body code to be skipped
260 return $self->_body(0) unless my $length = $self->_read_length;
262 # Unless the body has already been set, create it. Not sure about this
263 # code, how else might it be set, but this was existing logic.
265 unless ($self->_body) {
266 my $type = $self->header('Content-Type');
267 $self->_body(HTTP::Body->new( $type, $length ));
268 $self->_body->cleanup(1);
270 # JNAP: I'm not sure this is doing what we expect, but it also doesn't
271 # seem to be hurting (seems ->_has_uploadtmp is true more than I would
274 $self->_body->tmpdir( $self->_uploadtmp )
275 if $self->_has_uploadtmp;
278 # Ok if we get this far, we have to read psgi.input into the new body
279 # object. Lets play nice with any plack app or other downstream, so
280 # we create a buffer unless one exists.
283 if ($self->env->{'psgix.input.buffered'}) {
284 # Be paranoid about previous psgi middleware or apps that read the
285 # input but didn't return the buffer to the start.
286 $self->env->{'psgi.input'}->seek(0, 0);
288 $stream_buffer = Stream::Buffered->new($length);
291 # Check for definedness as you could read '0'
292 while ( defined ( my $chunk = $self->read() ) ) {
293 $self->prepare_body_chunk($chunk);
294 $stream_buffer->print($chunk) if $stream_buffer;
297 # Ok, we read the body. Lets play nice for any PSGI app down the pipe
299 if ($stream_buffer) {
300 $self->env->{'psgix.input.buffered'} = 1;
301 $self->env->{'psgi.input'} = $stream_buffer->rewind;
303 $self->env->{'psgi.input'}->seek(0, 0); # Reset the buffer for downstream middleware or apps
306 # paranoia against wrong Content-Length header
307 my $remaining = $length - $self->_read_position;
308 if ( $remaining > 0 ) {
309 Catalyst::Exception->throw("Wrong Content-Length value: $length" );
313 sub prepare_body_chunk {
314 my ( $self, $chunk ) = @_;
316 $self->_body->add($chunk);
319 sub prepare_body_parameters {
320 my ( $self, $c ) = @_;
322 $self->prepare_body if ! $self->_has_body;
324 unless($self->_body) {
325 return $self->_use_hash_multivalue ? Hash::MultiValue->new : {};
328 my $params = $self->_body->param;
330 # If we have an encoding configured (like UTF-8) in general we expect a client
331 # to POST with the encoding we fufilled the request in. Otherwise don't do any
332 # encoding (good change wide chars could be in HTML entity style llike the old
335 # so, now that HTTP::Body prepared the body params, we gotta 'walk' the structure
336 # and do any needed decoding.
338 # This only does something if the encoding is set via the encoding param. Remember
339 # this is assuming the client is not bad and responds with what you provided. In
340 # general you can just use utf8 and get away with it.
342 # I need to see if $c is here since this also doubles as a builder for the object :(
344 if($c and $c->encoding) {
345 $params = $c->_handle_unicode_decoding($params);
348 return $self->_use_hash_multivalue ?
349 Hash::MultiValue->from_mixed($params) :
353 sub prepare_connection {
356 my $env = $self->env;
358 $self->address( $env->{REMOTE_ADDR} );
359 $self->hostname( $env->{REMOTE_HOST} )
360 if exists $env->{REMOTE_HOST};
361 $self->protocol( $env->{SERVER_PROTOCOL} );
362 $self->remote_user( $env->{REMOTE_USER} );
363 $self->method( $env->{REQUEST_METHOD} );
364 $self->secure( $env->{'psgi.url_scheme'} eq 'https' ? 1 : 0 );
367 # XXX - FIXME - method is here now, move this crap...
368 around parameters => sub {
369 my ($orig, $self, $params) = @_;
371 if ( !ref $params ) {
373 "Attempt to retrieve '$params' with req->params(), " .
374 "you probably meant to call req->param('$params')"
378 return $self->$orig($params);
389 return $self->path if $self->has_uri;
394 is => 'rw', clearer => '_clear_body', predicate => '_has_body',
396 # Eugh, ugly. Should just be able to rename accessor methods to 'body'
397 # and provide a custom reader..
400 $self->prepare_body unless $self->_has_body;
401 croak 'body is a reader' if scalar @_;
402 return blessed $self->_body ? $self->_body->body : $self->_body;
411 gethostbyaddr( inet_aton( $self->address ), AF_INET ) || $self->address
415 has _path => ( is => 'rw', predicate => '_has_path', clearer => '_clear_path' );
417 sub args { shift->arguments(@_) }
418 sub body_params { shift->body_parameters(@_) }
419 sub input { shift->body(@_) }
420 sub params { shift->parameters(@_) }
421 sub query_params { shift->query_parameters(@_) }
422 sub path_info { shift->path(@_) }
424 =for stopwords param params
428 Catalyst::Request - provides information about the current client request
433 $req->address eq "127.0.0.1";
439 $req->body_parameters;
440 $req->content_encoding;
441 $req->content_length;
449 $req->query_keywords;
457 $req->query_parameters;
469 See also L<Catalyst>, L<Catalyst::Request::Upload>.
473 This is the Catalyst Request class, which provides an interface to data for the
474 current client request. The request object is prepared by L<Catalyst::Engine>,
475 thus hiding the details of the particular engine implementation.
481 Returns the IP address of the client.
483 =head2 $req->arguments
485 Returns a reference to an array containing the arguments.
487 print $c->request->arguments->[0];
489 For example, if your action was
491 package MyApp::Controller::Foo;
497 and the URI for the request was C<http://.../foo/moose/bah>, the string C<bah>
498 would be the first and only argument.
500 Arguments get automatically URI-unescaped for you.
504 Shortcut for L</arguments>.
508 Contains the URI base. This will always have a trailing slash. Note that the
509 URI scheme (e.g., http vs. https) must be determined through heuristics;
510 depending on your server configuration, it may be incorrect. See $req->secure
513 If your application was queried with the URI
514 C<http://localhost:3000/some/path> then C<base> is C<http://localhost:3000/>.
518 Returns the message body of the request, as returned by L<HTTP::Body>: a string,
519 unless Content-Type is C<application/x-www-form-urlencoded>, C<text/xml>, or
520 C<multipart/form-data>, in which case a L<File::Temp> object is returned.
522 =head2 $req->body_data
524 Returns a Perl representation of POST/PUT body data that is not classic HTML
525 form data, such as JSON, XML, etc. By default, Catalyst will parse incoming
526 data of the type 'application/json' and return access to that data via this
527 method. You may define addition data_handlers via a global configuration
528 setting. See L<Catalyst\DATA HANDLERS> for more information.
530 If the POST is malformed in some way (such as undefined or not content that
531 matches the content-type) we raise a L<Catalyst::Exception> with the error
534 If the POSTed content type does not match an availabled data handler, this
535 will also raise an exception.
537 =head2 $req->body_parameters
539 Returns a reference to a hash containing body (POST) parameters. Values can
540 be either a scalar or an arrayref containing scalars.
542 print $c->request->body_parameters->{field};
543 print $c->request->body_parameters->{field}->[0];
545 These are the parameters from the POST part of the request, if any.
547 =head2 $req->body_params
549 Shortcut for body_parameters.
551 =head2 $req->content_encoding
553 Shortcut for $req->headers->content_encoding.
555 =head2 $req->content_length
557 Shortcut for $req->headers->content_length.
559 =head2 $req->content_type
561 Shortcut for $req->headers->content_type.
565 A convenient method to access $req->cookies.
567 $cookie = $c->request->cookie('name');
568 @cookies = $c->request->cookie;
576 return keys %{ $self->cookies };
583 unless ( exists $self->cookies->{$name} ) {
587 return $self->cookies->{$name};
593 Returns a reference to a hash containing the cookies.
595 print $c->request->cookies->{mycookie}->value;
597 The cookies in the hash are indexed by name, and the values are L<CGI::Simple::Cookie>
602 Shortcut for $req->headers->header.
606 Returns an L<HTTP::Headers> object containing the headers for the current request.
608 print $c->request->headers->header('X-Catalyst');
610 =head2 $req->hostname
612 Returns the hostname of the client. Use C<< $req->uri->host >> to get the hostname of the server.
616 Alias for $req->body.
618 =head2 $req->query_keywords
620 Contains the keywords portion of a query string, when no '=' signs are
623 http://localhost/path?some+keywords
625 $c->request->query_keywords will contain 'some keywords'
629 This contains the matching part of a Regex action. Otherwise
630 it returns the same as 'action', except for default actions,
631 which return an empty string.
635 Contains the request method (C<GET>, C<POST>, C<HEAD>, etc).
639 Returns GET and POST parameters with a CGI.pm-compatible param method. This
640 is an alternative method for accessing parameters in $c->req->parameters.
642 $value = $c->request->param( 'foo' );
643 @values = $c->request->param( 'foo' );
644 @params = $c->request->param;
646 Like L<CGI>, and B<unlike> earlier versions of Catalyst, passing multiple
647 arguments to this method, like this:
649 $c->request->param( 'foo', 'bar', 'gorch', 'quxx' );
651 will set the parameter C<foo> to the multiple values C<bar>, C<gorch> and
652 C<quxx>. Previously this would have added C<bar> as another value to C<foo>
653 (creating it if it didn't exist before), and C<quxx> as another value for
656 B<NOTE> this is considered a legacy interface and care should be taken when
657 using it. C<< scalar $c->req->param( 'foo' ) >> will return only the first
658 C<foo> param even if multiple are present; C<< $c->req->param( 'foo' ) >> will
659 return a list of as many are present, which can have unexpected consequences
660 when writing code of the form:
664 baz => $c->req->param( 'baz' ),
667 If multiple C<baz> parameters are provided this code might corrupt data or
668 cause a hash initialization error. For a more straightforward interface see
669 C<< $c->req->parameters >>.
671 B<NOTE> Interfaces like this, which are based on L<CGI> and the C<param> method
672 are now known to cause demonstrated exploits. It is highly recommended that you
673 avoid using this method, and migrate existing code away from it. Here's the
674 whitepaper of the exploit:
676 L<http://blog.gerv.net/2014/10/new-class-of-vulnerability-in-perl-web-applications/>
678 Basically this is an exploit that takes advantage of how L<\param> will do one thing
679 in scalar context and another thing in list context. This is combined with how Perl
680 chooses to deal with duplicate keys in a hash definition by overwriting the value of
681 existing keys with a new value if the same key shows up again. Generally you will be
682 vulnerale to this exploit if you are using this method in a direct assignment in a
683 hash, such as with a L<DBIx::Class> create statement. For example, if you have
686 user?user=123&foo=a&foo=user&foo=456
688 You could end up with extra parameters injected into your method calls:
690 $c->model('User')->create({
691 user => $c->req->param('user'),
692 foo => $c->req->param('foo'),
695 Which would look like:
697 $c->model('User')->create({
699 foo => qw(a user 456),
702 (or to be absolutely clear if you are not seeing it):
704 $c->model('User')->create({
709 Possible remediations include scrubbing your parameters with a form validator like
710 L<HTML::FormHandler> or being careful to force scalar context using the scalar
713 $c->model('User')->create({
714 user => scalar($c->req->param('user')),
715 foo => scalar($c->req->param('foo')),
718 Upcoming versions of L<Catalyst> will disable this interface by default and require
719 you to positively enable it should you require it for backwards compatibility reasons.
727 return keys %{ $self->parameters };
730 # If anything in @_ is undef, carp about that, and remove it from
733 my @params = grep { defined($_) ? 1 : do {carp "You called ->params with an undefined value"; 0} } @_;
735 if ( @params == 1 ) {
737 defined(my $param = shift @params) ||
738 carp "You called ->params with an undefined value 2";
740 unless ( exists $self->parameters->{$param} ) {
741 return wantarray ? () : undef;
744 if ( ref $self->parameters->{$param} eq 'ARRAY' ) {
746 ? @{ $self->parameters->{$param} }
747 : $self->parameters->{$param}->[0];
751 ? ( $self->parameters->{$param} )
752 : $self->parameters->{$param};
755 elsif ( @params > 1 ) {
756 my $field = shift @params;
757 $self->parameters->{$field} = [@params];
761 =head2 $req->parameters
763 Returns a reference to a hash containing GET and POST parameters. Values can
764 be either a scalar or an arrayref containing scalars.
766 print $c->request->parameters->{field};
767 print $c->request->parameters->{field}->[0];
769 This is the combination of C<query_parameters> and C<body_parameters>.
773 Shortcut for $req->parameters.
777 Returns the path, i.e. the part of the URI after $req->base, for the current request.
779 http://localhost/path/foo
781 $c->request->path will contain 'path/foo'
783 =head2 $req->path_info
785 Alias for path, added for compatibility with L<CGI>.
790 my ( $self, @params ) = @_;
793 $self->uri->path(@params);
796 elsif ( $self->_has_path ) {
800 my $path = $self->uri->path;
801 my $location = $self->base->path;
802 $path =~ s/^(\Q$location\E)?//;
810 =head2 $req->protocol
812 Returns the protocol (HTTP/1.0 or HTTP/1.1) used for the current request.
814 =head2 $req->query_parameters
816 =head2 $req->query_params
818 Returns a reference to a hash containing query string (GET) parameters. Values can
819 be either a scalar or an arrayref containing scalars.
821 print $c->request->query_parameters->{field};
822 print $c->request->query_parameters->{field}->[0];
824 =head2 $req->read( [$maxlength] )
826 Reads a chunk of data from the request body. This method is intended to be
827 used in a while loop, reading $maxlength bytes on every call. $maxlength
828 defaults to the size of the request if not specified.
830 =head2 $req->read_chunk(\$buff, $max)
834 You have to set MyApp->config(parse_on_demand => 1) to use this directly.
838 Shortcut for $req->headers->referer. Returns the referring page.
842 Returns true or false, indicating whether the connection is secure
843 (https). The reliability of $req->secure may depend on your server
844 configuration; Catalyst relies on PSGI to determine whether or not a
845 request is secure (Catalyst looks at psgi.url_scheme), and different
846 PSGI servers may make this determination in different ways (as by
847 directly passing along information from the server, interpreting any of
848 several HTTP headers, or using heuristics of their own).
850 =head2 $req->captures
852 Returns a reference to an array containing captured args from chained
853 actions or regex captures.
855 my @captures = @{ $c->request->captures };
859 A convenient method to access $req->uploads.
861 $upload = $c->request->upload('field');
862 @uploads = $c->request->upload('field');
863 @fields = $c->request->upload;
865 for my $upload ( $c->request->upload('field') ) {
866 print $upload->filename;
875 return keys %{ $self->uploads };
882 unless ( exists $self->uploads->{$upload} ) {
883 return wantarray ? () : undef;
886 if ( ref $self->uploads->{$upload} eq 'ARRAY' ) {
888 ? @{ $self->uploads->{$upload} }
889 : $self->uploads->{$upload}->[0];
893 ? ( $self->uploads->{$upload} )
894 : $self->uploads->{$upload};
900 while ( my ( $field, $upload ) = splice( @_, 0, 2 ) ) {
902 if ( exists $self->uploads->{$field} ) {
903 for ( $self->uploads->{$field} ) {
904 $_ = [$_] unless ref($_) eq "ARRAY";
905 push( @$_, $upload );
909 $self->uploads->{$field} = $upload;
917 Returns a reference to a hash containing uploads. Values can be either a
918 L<Catalyst::Request::Upload> object, or an arrayref of
919 L<Catalyst::Request::Upload> objects.
921 my $upload = $c->request->uploads->{field};
922 my $upload = $c->request->uploads->{field}->[0];
926 Returns a L<URI> object for the current request. Stringifies to the URI text.
928 =head2 $req->mangle_params( { key => 'value' }, $appendmode);
930 Returns a hashref of parameters stemming from the current request's params,
931 plus the ones supplied. Keys for which no current param exists will be
932 added, keys with undefined values will be removed and keys with existing
933 params will be replaced. Note that you can supply a true value as the final
934 argument to change behavior with regards to existing parameters, appending
935 values rather than replacing them.
939 # URI query params foo=1
940 my $hashref = $req->mangle_params({ foo => 2 });
941 # Result is query params of foo=2
945 # URI query params foo=1
946 my $hashref = $req->mangle_params({ foo => 2 }, 1);
947 # Result is query params of foo=1&foo=2
949 This is the code behind C<uri_with>.
954 my ($self, $args, $append) = @_;
956 carp('No arguments passed to mangle_params()') unless $args;
958 foreach my $value ( values %$args ) {
959 next unless defined $value;
960 for ( ref $value eq 'ARRAY' ? @$value : $value ) {
966 my %params = %{ $self->uri->query_form_hash };
967 foreach my $key (keys %{ $args }) {
968 my $val = $args->{$key};
971 if($append && exists($params{$key})) {
973 # This little bit of heaven handles appending a new value onto
974 # an existing one regardless if the existing value is an array
975 # or not, and regardless if the new value is an array or not
977 ref($params{$key}) eq 'ARRAY' ? @{ $params{$key} } : $params{$key},
978 ref($val) eq 'ARRAY' ? @{ $val } : $val
982 $params{$key} = $val;
986 # If the param wasn't defined then we delete it.
987 delete($params{$key});
995 =head2 $req->uri_with( { key => 'value' } );
997 Returns a rewritten URI object for the current request. Key/value pairs
998 passed in will override existing parameters. You can remove an existing
999 parameter by passing in an undef value. Unmodified pairs will be
1002 You may also pass an optional second parameter that puts C<uri_with> into
1005 $req->uri_with( { key => 'value' }, { mode => 'append' } );
1007 See C<mangle_params> for an explanation of this behavior.
1012 my( $self, $args, $behavior) = @_;
1014 carp( 'No arguments passed to uri_with()' ) unless $args;
1017 if((ref($behavior) eq 'HASH') && defined($behavior->{mode}) && ($behavior->{mode} eq 'append')) {
1021 my $params = $self->mangle_params($args, $append);
1023 my $uri = $self->uri->clone;
1024 $uri->query_form($params);
1029 =head2 $req->remote_user
1031 Returns the value of the C<REMOTE_USER> environment variable.
1033 =head2 $req->user_agent
1035 Shortcut to $req->headers->user_agent. Returns the user agent (browser)
1040 Returns a psgix.io bidirectional socket, if your server supports one. Used for
1041 when you want to jailbreak out of PSGI and handle bidirectional client server
1042 communication manually, such as when you are using cometd or websockets.
1044 =head1 SETUP METHODS
1046 You should never need to call these yourself in application code,
1047 however they are useful if extending Catalyst by applying a request role.
1049 =head2 $self->prepare_headers()
1051 Sets up the C<< $res->headers >> accessor.
1053 =head2 $self->prepare_body()
1055 Sets up the body using L<HTTP::Body>
1057 =head2 $self->prepare_body_chunk()
1059 Add a chunk to the request body.
1061 =head2 $self->prepare_body_parameters()
1063 Sets up parameters from body.
1065 =head2 $self->prepare_cookies()
1067 Parse cookies from header. Sets up a L<CGI::Simple::Cookie> object.
1069 =head2 $self->prepare_connection()
1071 Sets up various fields in the request like the local and remote addresses,
1072 request method, hostname requested etc.
1074 =head2 $self->prepare_parameters()
1076 Ensures that the body has been parsed, then builds the parameters, which are
1077 combined from those in the request and those in the body.
1079 If parameters have already been set will clear the parameters and build them again.
1083 Access to the raw PSGI env.
1091 Catalyst Contributors, see Catalyst.pm
1095 This library is free software. You can redistribute it and/or modify
1096 it under the same terms as Perl itself.
1100 __PACKAGE__->meta->make_immutable;