From: Max Kanat-Alexander Date: Wed, 19 May 2010 16:26:38 +0000 (-0700) Subject: Bug 376044: If we're running under mod_perl, use a refresh-style redirect X-Git-Tag: bugzilla-3.6.1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a7c87e1d85dc6bddcfbe19556f0e13e61b8f4cc;p=thirdparty%2Fbugzilla.git Bug 376044: If we're running under mod_perl, use a refresh-style redirect when coming back from colchange.cgi, because CGI.pm sometimes does not send headers properly under mod_perl when redirecting and sending cookies at the same time. r=justdave, a=mkanat --- diff --git a/colchange.cgi b/colchange.cgi index f8ba353e47..9c9addb48e 100755 --- a/colchange.cgi +++ b/colchange.cgi @@ -150,10 +150,13 @@ if (defined $cgi->param('rememberedquery')) { $vars->{'redirect_url'} = "buglist.cgi?".$params->query_string(); - # If we're running on Microsoft IIS, using cgi->redirect discards - # the Set-Cookie lines -- workaround is to use the old-fashioned - # redirection mechanism. See bug 214466 for details. - if ($ENV{'SERVER_SOFTWARE'} =~ /Microsoft-IIS/ + # If we're running on Microsoft IIS, $cgi->redirect discards + # the Set-Cookie lines. In mod_perl, $cgi->redirect with cookies + # causes the page to be rendered as text/plain. + # Workaround is to use the old-fashioned redirection mechanism. + # See bug 214466 and bug 376044 for details. + if ($ENV{'MOD_PERL'} + || $ENV{'SERVER_SOFTWARE'} =~ /Microsoft-IIS/ || $ENV{'SERVER_SOFTWARE'} =~ /Sun ONE Web/) { print $cgi->header(-type => "text/html",