Changeset 5915 for trunk/ModPerlEngineContrib/lib/Foswiki/Engine/Apache.pm
- Timestamp:
- 01/03/10 13:12:10 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ModPerlEngineContrib/lib/Foswiki/Engine/Apache.pm
r4569 r5915 78 78 use Foswiki::Response (); 79 79 use File::Spec (); 80 use Assert; 80 81 81 82 sub run { … … 209 210 my ( $this, $res, $req ) = @_; 210 211 $this->SUPER::finalizeHeaders( $res, $req ); 211 my ($status) = ( $res->status || "200" ) =~ /^(\d\d\d)/o; 212 213 $this->{r}->status( $res->status || 200 ); 212 213 # If REDIRECT_STATUS is present, preserve it. See Foswikitask:Item2549 214 # and http://httpd.apache.org/docs/2.2/en/custom-error.html#custom 215 my $status; 216 if (defined $ENV{REDIRECT_STATUS}) { 217 $status = $ENV{REDIRECT_STATUS}; 218 } 219 elsif (defined $res->status && $res->status =~ /^\s*(\d{3})/o) { 220 $status = $1; 221 } 222 else { 223 $status = 200; 224 } 225 $this->{r}->status($status); 226 214 227 while ( my ( $header, $value ) = each %{ $res->headers } ) { 215 228 if ( lc($header) eq 'content-type' ) { … … 229 242 } 230 243 } 231 els e{244 elsif ( lc($header) ne 'status' ) { 232 245 foreach ( ref($value) eq 'ARRAY' ? @$value : ($value) ) { 233 246 $this->{r}->headers_out->add( $header => $_ );
Note: See TracChangeset
for help on using the changeset viewer.
