From 8ad3c2bd01c2b6397a70fa73f4bc5e4460fef504 Mon Sep 17 00:00:00 2001 From: GilmarSantosJr Date: Sun, 3 Jan 2010 16:24:50 +0000 Subject: [PATCH] Item2549: respect REDIRECT_STATUS only if it is not 2xx. Thanks MarcSCHAEFER. git-svn-id: http://svn.foswiki.org/trunk/ModPerlEngineContrib@5921 0b4bb1d4-4e5a-0410-9cc4-b2b747904278 --- ModPerlEngineContrib/lib/Foswiki/Engine/Apache.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ModPerlEngineContrib/lib/Foswiki/Engine/Apache.pm b/ModPerlEngineContrib/lib/Foswiki/Engine/Apache.pm index 2c138f094e..de6488fe91 100644 --- a/ModPerlEngineContrib/lib/Foswiki/Engine/Apache.pm +++ b/ModPerlEngineContrib/lib/Foswiki/Engine/Apache.pm @@ -210,10 +210,10 @@ sub finalizeHeaders { my ( $this, $res, $req ) = @_; $this->SUPER::finalizeHeaders( $res, $req ); - # If REDIRECT_STATUS is present, preserve it. See Foswikitask:Item2549 + # If REDIRECT_STATUS is useful, preserve it. See Foswikitask:Item2549 # and http://httpd.apache.org/docs/2.2/en/custom-error.html#custom my $status; - if (defined $ENV{REDIRECT_STATUS}) { + if (defined $ENV{REDIRECT_STATUS} && $ENV{REDIRECT_STATUS} !~ /^2/o) { $status = $ENV{REDIRECT_STATUS}; } elsif (defined $res->status && $res->status =~ /^\s*(\d{3})/o) {