From: cjwatson <> Date: Mon, 22 Sep 2003 04:30:40 +0000 (-0800) Subject: [project @ 2003-09-21 21:30:40 by cjwatson] X-Git-Tag: release/2.6.0~780 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=654dd079e8f78443f2c4eafac9431b77d019fb71;p=debbugs.git [project @ 2003-09-21 21:30:40 by cjwatson] Reduce noise when running from the command line without all the CGI environment variables set. --- diff --git a/cgi/common.pl b/cgi/common.pl index 4ab1cc42..63f0db0f 100644 --- a/cgi/common.pl +++ b/cgi/common.pl @@ -46,6 +46,7 @@ sub contains_field_match { sub detect_user_agent { my $userAgent = $ENV{HTTP_USER_AGENT}; + return { 'name' => 'unknown' } unless defined $userAgent; return { 'name' => 'links' } if ( $userAgent =~ m,^ELinks,); return { 'name' => 'lynx' } if ( $userAgent =~ m,^Lynx,); return { 'name' => 'wget' } if ( $userAgent =~ m,^Wget,); @@ -53,6 +54,7 @@ sub detect_user_agent { return { 'name' => 'ie' } if ( $userAgent =~ m,^.*MSIE.*,); return { 'name' => 'unknown' }; } + my %field_match = ( 'subject' => \&contains_field_match, 'tags' => sub { diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi index 0d1fc7f7..6eaa7004 100755 --- a/cgi/pkgreport.cgi +++ b/cgi/pkgreport.cgi @@ -13,7 +13,7 @@ require '/etc/debbugs/text'; use vars qw($gPackagePages $gWebDomain); -if ($ENV{REQUEST_METHOD} eq 'HEAD') { +if (defined $ENV{REQUEST_METHOD} and $ENV{REQUEST_METHOD} eq 'HEAD') { print "Content-Type: text/html\n\n"; exit 0; }