]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 643925: When shutdownhtml sends an HTTP 503, also include a Retry-After
authorBjoern Jacke <bjoern@j3e.de>
Tue, 22 Mar 2011 23:55:34 +0000 (16:55 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 22 Mar 2011 23:55:34 +0000 (16:55 -0700)
header.
r=mkanat, a=mkanat

Bugzilla.pm

index 2f657e3deda4e68f28d82481ef2f07596ace1b04..65ddcc2bceebed0e74e47cf61734769b1eb9d28e 100644 (file)
@@ -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);