From: cjwatson <> Date: Sat, 4 Jan 2003 00:01:32 +0000 (-0800) Subject: [project @ 2003-01-03 16:01:32 by cjwatson] X-Git-Tag: release/2.6.0~969 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=987b3e4168f188b655760c0cf277e4db8e358569;p=debbugs.git [project @ 2003-01-03 16:01:32 by cjwatson] Print a Last-Modified: header with the bug log's mtime for HEAD requests. --- diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index 636e154..b0265da 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -16,18 +16,10 @@ require '/etc/debbugs/text'; use vars(qw($gEmailDomain $gHTMLTail $gSpoolDir $gWebDomain)); -if ($ENV{REQUEST_METHOD} eq 'HEAD') { - print "Content-Type: text/html\n\n"; - exit 0; -} - my %param = readparse(); my $tail_html; -my %maintainer = %{getmaintainers()}; -my %pkgsrc = %{getpkgsrc()}; - my $ref = $param{'bug'} || quit("No bug number"); $ref =~ /(\d+)/ or quit("Invalid bug number"); $ref = $1; @@ -38,6 +30,22 @@ my $boring = ($param{'boring'} || 'no') eq 'yes'; my $reverse = ($param{'reverse'} || 'no') eq 'yes'; my $mbox = ($param{'mbox'} || 'no') eq 'yes'; +my $buglog = buglog($ref); + +if ($ENV{REQUEST_METHOD} eq 'HEAD') { + print "Content-Type: text/html\n"; + my @stat = stat $buglog; + if (@stat) { + my $mtime = strftime '%a, %d %b %Y %T GMT', gmtime($stat[9]); + print "Last-Modified: $mtime\n"; + } + print "\n"; + exit 0; +} + +my %maintainer = %{getmaintainers()}; +my %pkgsrc = %{getpkgsrc()}; + my $indexentry; my $descriptivehead; my $showseverity; @@ -127,7 +135,6 @@ $descriptivehead.= ";\nSource for $status{package} is\n". '$tsrc" if ($tsrc ne "(unknown)"); $descriptivehead.= ".

"; -my $buglog = buglog($ref); open L, "<$buglog" or &quit("open log for $ref: $!"); if ($buglog !~ m#^\Q$gSpoolDir/db-h/#) { $descriptivehead .= "\n

Bug is archived. No further changes may be made.

";