diff options
author | mkanat%bugzilla.org <> | 2006-07-12 15:05:07 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2006-07-12 15:05:07 +0200 |
commit | 8b6eecc5d9fe028933e51cfebaa62ed72eb073ce (patch) | |
tree | 6d5538146ed8971821b3b194a5ac01ad6d2f5ebf /Bugzilla | |
parent | dbb4dc8e4e689253f0e9c5d162f342e8e652c456 (diff) | |
download | bugzilla-8b6eecc5d9fe028933e51cfebaa62ed72eb073ce.tar.gz bugzilla-8b6eecc5d9fe028933e51cfebaa62ed72eb073ce.tar.xz |
Bug 342757: searching results in "YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY" warning on brower under mod_perl
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=justdave, a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/CGI.pm | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index b4bcf20c8..dd6061346 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -158,14 +158,27 @@ sub multipart_init { # CGI.pm's header() sets nph according to a param or $CGI::NPH, which # is the desired behaviour. - # Allow multiple calls to $cgi->header() - $CGI::HEADERS_ONCE = 0; - return $self->header( %param, ) . "WARNING: YOUR BROWSER DOESN'T SUPPORT THIS SERVER-PUSH TECHNOLOGY." . $self->multipart_end; } +# Have to add the cookies in. +sub multipart_start { + my $self = shift; + my $headers = $self->SUPER::multipart_start(@_); + # Eliminate the one extra CRLF at the end. + $headers =~ s/$CGI::CRLF$//; + # Add the cookies. We have to do it this way instead of + # passing them to multpart_start, because CGI.pm's multipart_start + # doesn't understand a '-cookie' argument pointing to an arrayref. + foreach my $cookie (@{$self->{Bugzilla_cookie_list}}) { + $headers .= "Set-Cookie: ${cookie}${CGI::CRLF}"; + } + $headers .= $CGI::CRLF; + return $headers; +} + # Override header so we can add the cookies in sub header { my $self = shift; @@ -183,13 +196,6 @@ sub header { return $self->SUPER::header(@_) || ""; } -# Override multipart_start to ensure our cookies are added and avoid bad quoting of -# CGI's multipart_start (bug 275108) -sub multipart_start { - my $self = shift; - return $self->header(@_); -} - # The various parts of Bugzilla which create cookies don't want to have to # pass them around to all of the callers. Instead, store them locally here, # and then output as required from |header|. |