Merge 'trunk' into 'proxystuff'
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index a0f4e75..42fdab9 100644 (file)
@@ -49,7 +49,6 @@ our $COUNT     = 1;
 our $START     = time;
 our $RECURSION = 1000;
 our $DETACH    = "catalyst_detach\n";
-our $GO        = "catalyst_go\n";
 
 __PACKAGE__->mk_classdata($_)
   for qw/components arguments dispatcher engine log dispatcher_class
@@ -328,20 +327,6 @@ When called with no arguments it escapes the processing chain entirely.
 
 sub detach { my $c = shift; $c->dispatcher->detach( $c, @_ ) }
 
-=head2 $c->go( $action [, \@arguments ] )
-
-=head2 $c->go( $class, $method, [, \@arguments ] )
-
-Almost the same as C<detach>, but does a full dispatch, instead of just
-calling the new C<$action> / C<$class-E<gt>$method>. This means that C<begin>,
-C<auto> and the method you go to is called, just like a new request.
-
-C<$c-E<gt>stash> is kept unchanged.
-
-=cut
-
-sub go { my $c = shift; $c->dispatcher->go( $c, @_ ) }
-
 =head2 $c->response
 
 =head2 $c->res
@@ -1339,9 +1324,6 @@ sub execute {
         if ( !ref($error) and $error eq $DETACH ) {
             die $DETACH if($c->depth > 1);
         }
-        elsif ( !ref($error) and $error eq $GO ) {
-            die $GO if($c->depth > 0);
-        }
         else {
             unless ( ref $error ) {
                 no warnings 'uninitialized';
@@ -1698,9 +1680,9 @@ sub prepare {
     }
     else {
         $c->prepare_request(@arguments);
+        $c->prepare_headers;
         $c->prepare_connection;
         $c->prepare_query_parameters;
-        $c->prepare_headers;
         $c->prepare_cookies;
         $c->prepare_path;
 
@@ -1835,6 +1817,14 @@ Prepares path and base.
 
 sub prepare_path { my $c = shift; $c->engine->prepare_path( $c, @_ ) }
 
+=head2 $c->adjust_request_for_proxy
+
+Adjusts the request to account for a frontend proxy.
+
+=cut
+
+sub adjust_request_for_proxy { my $c = shift; $c->engine->adjust_request_for_proxy( $c, @_ ) }
+
 =head2 $c->prepare_query_parameters
 
 Prepares query parameters.
@@ -2411,11 +2401,38 @@ Catalyst will automatically detect this situation when you are running
 the frontend and backend servers on the same machine. The following
 changes are made to the request.
 
-    $c->req->address is set to the user's real IP address, as read from 
-    the HTTP X-Forwarded-For header.
-    
-    The host value for $c->req->base and $c->req->uri is set to the real
-    host, as read from the HTTP X-Forwarded-Host header.
+=over 4
+
+=item * X-Forwarded-For
+
+The IP address in C<< $c->req->address >> is set to the user's real IP
+address, as read from the X-Forwarded-For header.
+
+=item * X-Forwarded-Host
+
+The host value for C<< $c->req->base >> and C<< $c->req->uri >> is set
+to the real host, as read from the X-Forwarded-Host header. The value
+of C<< $c->req->hostname >> is also adjusted accordingly.
+
+=item * X-Forwarded-Port
+
+The port value for C<< $c->req->base >> and C<< $c->req->uri >> is set
+to the real port, as read from the X-Forwarded-Port header.
+
+=item * X-Forwarded-Path
+
+If this is set, the value of the X-Forwarded-Path header is
+I<prepended> to the path value of C<< $c->req->base >> and C<<
+$c->req->uri >>.
+
+=item * X-Forwarded-Is-SSL
+
+If this is set, the scheme value of C<< $c->req->base >> and C<<
+$c->req->uri >> is set to "https". Additional, C<< $c->req->protocol
+>> is also set to "https", and C<< $c->req->secure >> is set to a true
+value.
+
+=back
 
 Obviously, your web server must support these headers for this to work.