diff options
author | Bjoern Jacke <bjoern@j3e.de> | 2011-03-23 00:55:34 +0100 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2011-03-23 00:55:34 +0100 |
commit | a011cac4d115c49f5cc2742027a0009aa3bc4722 (patch) | |
tree | 52e199de3be701430137b4e6e44e6293b2d4464a | |
parent | 764a1fa6d114eee04b04ec1419052e3e4caa02d2 (diff) | |
download | bugzilla-a011cac4d115c49f5cc2742027a0009aa3bc4722.tar.gz bugzilla-a011cac4d115c49f5cc2742027a0009aa3bc4722.tar.xz |
Bug 643925: When shutdownhtml sends an HTTP 503, also include a Retry-After
header.
r=mkanat, a=mkanat
-rw-r--r-- | Bugzilla.pm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm index 2f657e3de..65ddcc2bc 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -76,6 +76,10 @@ use constant SHUTDOWNHTML_EXIT_SILENTLY => qw( 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 ##################################################################### @@ -170,9 +174,12 @@ sub init_page { else { $extension = 'txt'; } - # Set the HTTP status to 503 when Bugzilla is down to avoid pages - # from being indexed. - print Bugzilla->cgi->header(-status=>503) if i_am_cgi(); + if (i_am_cgi()) { + # Set the HTTP status to 503 when Bugzilla is down to avoid pages + # being indexed by search engines. + print Bugzilla->cgi->header(-status => 503, + -retry_after => SHUTDOWNHTML_RETRY_AFTER); + } my $t_output; $template->process("global/message.$extension.tmpl", $vars, \$t_output) || ThrowTemplateError($template->error); |