X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=blobdiff_plain;f=cgi%2Fbugreport.cgi;h=b68eac64b7f9ba7c92d38e0d151ce1431362d18f;hp=fabe9bc85dcc84146f3befbccebb4129c68bf789;hb=2e9c5a7baf46c2fed7baa3616cb451adabf6e0b2;hpb=a82045e6d1d4e3494f6e8af5833738d31c60d6b0 diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index fabe9bc..b68eac6 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -91,16 +91,24 @@ my %seen_users; my $buglog = buglog($ref); my $bug_status = bug_status($ref); if (not defined $buglog or not defined $bug_status) { - print $q->header(-status => "404 No such bug", - -type => "text/html", - -charset => 'utf-8', - ); - print fill_in_template(template=>'cgi/no_such_bug', - variables => {modify_time => strftime('%a, %e %b %Y %T UTC', gmtime), - bug_num => $ref, - }, - ); - exit 0; + no_such_bug($q,$ref); +} + +sub no_such_bug { + my ($q,$ref) = @_; + print $q->header(-status => 404, + -content_type => "text/html", + -charset => 'utf-8', + -cache_control => 'public, max-age=600', + ); + print fill_in_template(template=>'cgi/no_such_bug', + variables => {modify_time => strftime('%a, %e %b %Y %T UTC', gmtime), + bug_num => $ref, + }, + ); + exit 0; +} + } # the log should almost always be newer, but just in case @@ -300,16 +308,7 @@ my $tmain; my $dtime = strftime "%a, %e %b %Y %T UTC", gmtime; unless (%status) { - print $q->header(-type => "text/html", - -charset => 'utf-8', - (length $mtime)?(-last_modified => $mtime):(), - ); - print fill_in_template(template=>'cgi/no_such_bug', - variables => {modify_time => $dtime, - bug_num => $ref, - }, - ); - exit 0; + no_such_bug($q,$ref); } #$|=1;