Changeset 10393 for lang/perl/HTTPEx-Adaptor-ModPerl
- Timestamp:
- 04/25/08 09:42:57 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTPEx-Adaptor-ModPerl/trunk/lib/HTTPEx/Adaptor/ModPerl.pm
r10382 r10393 11 11 use URI::https; 12 12 13 use Apache2::Connection; 14 use Apache2::RequestRec; 15 use Apache2::RequestUtil; 16 use APR::Table; 17 13 18 use constant MP2 => ( 14 19 exists $ENV{MOD_PERL_API_VERSION} and … … 62 67 my ( $self, $adaptor, $c ) = @_; 63 68 64 $c->request->address( $self->apache->connection->remote_ip ); 69 my $apache = $self->apache; 70 my $config = $self->config; 71 72 $c->request->address( $apache->connection->remote_ip ); 65 73 66 74 PROXY_CHECK: 67 75 { 68 my $headers = $ self->apache->headers_in;69 unless ( $c ->config->{using_frontend_proxy} ) {76 my $headers = $apache->headers_in; 77 unless ( $config->{using_frontend_proxy} ) { 70 78 last PROXY_CHECK if $c->request->address ne '127.0.0.1'; 71 last PROXY_CHECK if $c ->config->{ignore_frontend_proxy};79 last PROXY_CHECK if $config->{ignore_frontend_proxy}; 72 80 } 73 81 last PROXY_CHECK unless $headers->{'X-Forwarded-For'}; … … 87 95 $c->request->secure(1) if $self->apache->connection->is_https; 88 96 } else { 89 my $https = $ self->apache->subprocess_env('HTTPS');97 my $https = $apache->subprocess_env('HTTPS'); 90 98 $c->request->secure(1) if defined $https and uc $https eq 'ON'; 91 99 } … … 115 123 my ( $self, $adaptor, $c ) = @_; 116 124 125 my $apache = $self->apache; 126 my $config = $self->config; 127 117 128 my $scheme = $c->request->secure ? 'https' : 'http'; 118 my $host = $ self->apache->hostname || 'localhost';119 my $port = $ self->apache->get_server_port;129 my $host = $apache->hostname || 'localhost'; 130 my $port = $apache->get_server_port; 120 131 121 132 # If we are running as a backend proxy, get the true hostname 122 133 PROXY_CHECK: 123 134 { 124 unless ( $c ->config->{using_frontend_proxy} ) {135 unless ( $config->{using_frontend_proxy} ) { 125 136 last PROXY_CHECK if $host !~ /localhost|127.0.0.1/; 126 last PROXY_CHECK if $c ->config->{ignore_frontend_proxy};137 last PROXY_CHECK if $config->{ignore_frontend_proxy}; 127 138 } 128 139 last PROXY_CHECK unless $c->request->header( 'X-Forwarded-Host' ); … … 143 154 144 155 # Are we running in a non-root Location block? 145 my $location = $ self->apache->location;156 my $location = $apache->location; 146 157 if ( $location && $location ne '/' ) { 147 158 $base_path = $location; … … 161 172 162 173 if ( MP2 ) { 163 ($path, $qs) = split /\?/, $ self->apache->unparsed_uri, 2;174 ($path, $qs) = split /\?/, $apache->unparsed_uri, 2; 164 175 } 165 176 else { 166 my (undef, $path_query) = split / /, $ self->apache->the_request, 3;177 my (undef, $path_query) = split / /, $apache->the_request, 3; 167 178 ($path, $qs) = split /\?/, $path_query, 2; 168 179 } … … 170 181 # Don't check for LocationMatch blocks if requested 171 182 # http://rt.cpan.org/Ticket/Display.html?id=26921 172 if ( $ self->apache->dir_config('CatalystDisableLocationMatch') ) {183 if ( $apache->dir_config('HTTPEngineDisableLocationMatch') ) { 173 184 $base_path = ''; 174 185 } … … 194 205 # this way is beyond me, but we'll support it! 195 206 # XXX: This needs a test 196 if ( defined $ENV{SCRIPT_NAME} && $ self->apache->filename && -f $self->apache->filename && -x _ ) {207 if ( defined $ENV{SCRIPT_NAME} && $apache->filename && -f $apache->filename && -x _ ) { 197 208 $base_path .= $ENV{SCRIPT_NAME}; 198 209 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)