From: Sebastian Riedel Date: Wed, 2 Mar 2005 20:01:04 +0000 (+0000) Subject: added server_base X-Git-Tag: 5.7099_04~1793 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=8495c1decb1fab254162f713255ece0372c2697d added server_base --- diff --git a/Changes b/Changes index 5fd22a9..7d45390 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,7 @@ This file documents the revision history for Perl extension Catalyst. - removed some warnings - improved docs - private prefixed actions override private non prefixed actions + - added server_base 4.10 Wed Mar 02 10:00:00 2005 - improved documentation diff --git a/lib/Catalyst/Engine/Apache.pm b/lib/Catalyst/Engine/Apache.pm index 0bba6ad..5d117e6 100644 --- a/lib/Catalyst/Engine/Apache.pm +++ b/lib/Catalyst/Engine/Apache.pm @@ -142,6 +142,7 @@ sub prepare_path { $base->port( $c->apache_request->get_server_port ); $base->path( $c->apache_request->location ); $c->req->base( $base->as_string ); + $c->req->server_base( $base->scheme . '://' . $base->authority ); } =head3 prepare_request diff --git a/lib/Catalyst/Engine/CGI.pm b/lib/Catalyst/Engine/CGI.pm index 44d1903..67ec08c 100644 --- a/lib/Catalyst/Engine/CGI.pm +++ b/lib/Catalyst/Engine/CGI.pm @@ -125,6 +125,7 @@ sub prepare_path { $base = URI->new($base); $base->path('/') if ( $ENV{CATALYST_TEST} || !$base->path ); $c->req->base( $base->as_string ); + $c->req->server_base( $base->scheme . '://' . $base->authority ); } =head3 prepare_request @@ -166,4 +167,3 @@ the same terms as Perl itself. =cut 1; -## Please see file perltidy.ERR diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index b63e48d..4a97566 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -5,7 +5,7 @@ use base 'Class::Accessor::Fast'; __PACKAGE__->mk_accessors( qw/action arguments base cookies headers match method parameters path - snippets uploads/ + server_base snippets uploads/ ); *args = \&arguments; @@ -77,6 +77,10 @@ Contains the request method. print $c->request->method +=head3 server_base + +Contains the server part of the uri base. + =head3 snippets Returns an arrayref containing regex snippets.