Commit a011cac4 authored by Bjoern Jacke's avatar Bjoern Jacke Committed by Max Kanat-Alexander

Bug 643925: When shutdownhtml sends an HTTP 503, also include a Retry-After

header. r=mkanat, a=mkanat
parent 764a1fa6
...@@ -76,6 +76,10 @@ use constant SHUTDOWNHTML_EXIT_SILENTLY => qw( ...@@ -76,6 +76,10 @@ use constant SHUTDOWNHTML_EXIT_SILENTLY => qw(
whine.pl whine.pl
); );
# shutdownhtml pages are sent as an HTTP 503. After how many seconds
# should search engines attempt to index the page again?
use constant SHUTDOWNHTML_RETRY_AFTER => 3600;
##################################################################### #####################################################################
# Global Code # Global Code
##################################################################### #####################################################################
...@@ -170,9 +174,12 @@ sub init_page { ...@@ -170,9 +174,12 @@ sub init_page {
else { else {
$extension = 'txt'; $extension = 'txt';
} }
# Set the HTTP status to 503 when Bugzilla is down to avoid pages if (i_am_cgi()) {
# from being indexed. # Set the HTTP status to 503 when Bugzilla is down to avoid pages
print Bugzilla->cgi->header(-status=>503) if i_am_cgi(); # being indexed by search engines.
print Bugzilla->cgi->header(-status => 503,
-retry_after => SHUTDOWNHTML_RETRY_AFTER);
}
my $t_output; my $t_output;
$template->process("global/message.$extension.tmpl", $vars, \$t_output) $template->process("global/message.$extension.tmpl", $vars, \$t_output)
|| ThrowTemplateError($template->error); || ThrowTemplateError($template->error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment