return 0;
}
-# Overwrite to ensure nph doesn't get set, and unset HEADERS_ONCE
-sub multipart_init {
- my $self = shift;
-
- # Keys are case-insensitive, map to lowercase
- my %args = @_;
- my %param;
- foreach my $key (keys %args) {
- $param{lc $key} = $args{$key};
- }
-
- # Set the MIME boundary and content-type
- my $boundary
- = $param{'-boundary'} || '------- =_' . generate_random_password(16);
- delete $param{'-boundary'};
- $self->{'separator'} = "\r\n--$boundary\r\n";
- $self->{'final_separator'} = "\r\n--$boundary--\r\n";
- $param{'-type'} = CGI::SERVER_PUSH($boundary);
-
- # Note: CGI.pm::multipart_init up to v3.04 explicitly set nph to 0
- # CGI.pm::multipart_init v3.05 explicitly sets nph to 1
- # CGI.pm's header() sets nph according to a param or $CGI::NPH, which
- # is the desired behaviour.
-
- 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 %args = @_;
-
- # CGI.pm::multipart_start doesn't honour its own charset information, so
- # we do it ourselves here
- if (defined $self->charset() && defined $args{-type}) {
-
- # Remove any existing charset specifier
- $args{-type} =~ s/;.*$//;
-
- # and add the specified one
- $args{-type} .= '; charset=' . $self->charset();
- }
-
- my $headers = $self->SUPER::multipart_start(%args);
-
- # 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;
- $self->{_multipart_in_progress} = 1;
- return $headers;
-}
-
-sub close_standby_message {
- my ($self, $contenttype, $disp, $disp_prefix, $extension) = @_;
- $self->set_dated_content_disp($disp, $disp_prefix, $extension);
-
- if ($self->{_multipart_in_progress}) {
- print $self->multipart_end();
- print $self->multipart_start(-type => $contenttype);
- }
- else {
- print $self->header($contenttype);
- }
-}
-
our $ALLOW_UNSAFE_RESPONSE = 0;
# responding to text/plain or text/html is safe
if (Bugzilla->error_mode == ERROR_MODE_WEBPAGE) {
Bugzilla->check_rate_limit("webpage_errors", remote_ip(), sub { $vars->{rate_limit_error} = 1 });
my $cgi = Bugzilla->cgi;
- $cgi->close_standby_message('text/html', 'inline', 'error', 'html');
+ $cgi->set_dated_content_disp('inline', 'error', 'html');
+ print $cgi->header('text/html');
$template->process($name, $vars) || ThrowTemplateError($template->error());
- print $cgi->multipart_final() if $cgi->{_multipart_in_progress};
$logfunc->("webpage error: $error");
}
elsif (Bugzilla->error_mode == ERROR_MODE_TEST) {
# Query Execution
################################################################################
-# Time to use server push to display an interim message to the user until
-# the query completes and we can display the bug list.
-
# Connect to the shadow database if this installation is using one to improve
# query performance.
$dbh = Bugzilla->switch_to_shadow_db();
$vars->{'human'} = $cgi->param('human');
}
-$cgi->close_standby_message($contenttype, $disposition, $disp_prefix,
- $format->{'extension'});
+$cgi->set_dated_content_disp($disposition, $disp_prefix, $format->{extension});
+print $cgi->header($contenttype);
################################################################################
# Content Generation
+++ /dev/null
-[%# The contents of this file are subject to the Mozilla Public
- # License Version 1.1 (the "License"); you may not use this file
- # except in compliance with the License. You may obtain a copy of
- # the License at http://www.mozilla.org/MPL/
- #
- # Software distributed under the License is distributed on an "AS
- # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- # implied. See the License for the specific language governing
- # rights and limitations under the License.
- #
- # The Original Code is the Bugzilla Bug Tracking System.
- #
- # The Initial Developer of the Original Code is Netscape Communications
- # Corporation. Portions created by Netscape are
- # Copyright (C) 1998 Netscape Communications Corporation. All
- # Rights Reserved.
- #
- # Contributor(s): Myk Melez <myk@mozilla.org>
- #%]
-
-[%# INTERFACE:
- # debug: boolean. True if we want the search displayed while we wait.
- # query: string. The SQL query which makes the buglist.
- #%]
-
-[% PROCESS global/variables.none.tmpl %]
-
-<html>
- <head>
- <title>[% terms.Bugzilla %] is pondering your search</title>
- </head>
- <body>
- <h1 style="margin-top: 20%; text-align: center;">Please stand by ...</h1>
-
- [% IF debug %]
- <p>[% query FILTER html %]</p>
- [% IF query_explain.defined %]
- <pre>[% query_explain FILTER html %]</pre>
- [% END %]
- [% END %]
- </body>
-</html>