X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cgi%2Flibravatar.cgi;h=276b3925fee74f07a658a9f595b457f66548ada0;hb=6d58a53155cd78fd9ae2b8726da7dd9fc179ffbd;hp=40a2989e3a7ab93515ed4b2d85a8ee717e8b628f;hpb=2b54b5ae54efbeadad868f1c0a79c5323416da0b;p=debbugs.git diff --git a/cgi/libravatar.cgi b/cgi/libravatar.cgi index 40a2989..276b392 100755 --- a/cgi/libravatar.cgi +++ b/cgi/libravatar.cgi @@ -13,10 +13,10 @@ use Debbugs::Libravatar qw(:libravatar); use Libravatar::URL; -use LWP::UserAgent; use HTTP::Request; use CGI::Simple; +use Cwd qw(abs_path); my $q = CGI::Simple->new(); @@ -42,7 +42,7 @@ if (cache_valid($cache_location)) { exit 0; } # if we don't have it, get it, and store it in the cache -$cache_location = retreive_libravatar(location => $cache_location, +$cache_location = retrieve_libravatar(location => $cache_location, email => lc($param{email}), ); if (not defined $cache_location) { @@ -65,12 +65,12 @@ sub serve_cache { error($q,404, "Failed to open cached image $cache_location"); my $m = File::LibMagic->new() or error($q,500,'Unable to create File::LibMagic object'); - my $mime_string = $m->checktype_filename($cache_location) or + my $mime_string = $m->checktype_filename(abs_path($cache_location)) or error($q,500,'Bad file; no mime known'); print $q->header(-type => $mime_string, -expires => '+1d', ); - print STDOUT <$fh>; + print <$fh>; close($fh); }