use Moose;
extends 'Catalyst::Engine';
-has env => (is => 'rw');
has _header_buf => (is => 'rw', clearer => '_clear_header_buf', predicate => '_has_header_buf');
=head1 NAME
$request->hostname( $ENV{REMOTE_HOST} ) if exists $ENV{REMOTE_HOST};
$request->protocol( $ENV{SERVER_PROTOCOL} );
- $request->user( $ENV{REMOTE_USER} );
+ $request->user( $ENV{REMOTE_USER} ); # XXX: Deprecated. See Catalyst::Request for removal information
+ $request->remote_user( $ENV{REMOTE_USER} );
$request->method( $ENV{REQUEST_METHOD} );
if ( $ENV{HTTPS} && uc( $ENV{HTTPS} ) eq 'ON' ) {
# set the request URI
my $path = $base_path . ( $ENV{PATH_INFO} || '' );
$path =~ s{^/+}{};
-
+
# Using URI directly is way too slow, so we construct the URLs manually
my $uri_class = "URI::$scheme";
-
+
# HTTP_HOST will include the port even if it's 80/443
$host =~ s/:(?:80|443)$//;
-
+
if ( $port !~ /^(?:80|443)$/ && $host !~ /:/ ) {
$host .= ":$port";
}
-
+
# Escape the path
$path =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go;
$path =~ s/\?/%3F/g; # STUPID STUPID SPECIAL CASE
-
+
my $query = $ENV{QUERY_STRING} ? '?' . $ENV{QUERY_STRING} : '';
my $uri = $scheme . '://' . $host . '/' . $path . $query;
# set the base URI
# base must end in a slash
$base_path .= '/' unless $base_path =~ m{/$};
-
+
my $base_uri = $scheme . '://' . $host . $base_path;
$c->request->base( bless \$base_uri, $uri_class );
=cut
-sub run { shift; shift->handle_request(@_) }
+sub run { shift; shift->handle_request( env => \%ENV ) }
=head1 SEE ALSO
=head1 COPYRIGHT
-This program is free software, you can redistribute it and/or modify it under
+This library is free software. You can redistribute it and/or modify it under
the same terms as Perl itself.
=cut