X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=42fdab931018f088734e3d1bf7a64f517a8e8d4f;hb=cb444200fdf24eed7ce342cabb51f43118e24f24;hp=ccc996e35d18deb0451de3caf2e1821fc589f8ac;hpb=c2c4666f087f803f27f8bd837da41574c631b326;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index ccc996e..42fdab9 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1680,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; @@ -1817,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. @@ -2393,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 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.