clean up credits code a little

This commit is contained in:
Graham Knop 2008-07-25 04:03:24 +00:00
parent 6126bf0fd7
commit e37db64483

View file

@ -16,6 +16,8 @@ package WebGUI::URL::Credits;
use strict; use strict;
use Apache2::Const -compile => qw(OK DECLINED); use Apache2::Const -compile => qw(OK DECLINED);
use APR::Finfo ();
use APR::Const -compile => qw(FINFO_NORM);
use WebGUI::Session; use WebGUI::Session;
=head1 NAME =head1 NAME
@ -47,17 +49,14 @@ The Apache request handler for this package.
sub handler { sub handler {
my ($request, $server, $config) = @_; my ($request, $server, $config) = @_;
$request->push_handlers(PerlResponseHandler => sub { my $filename = $config->getWebguiRoot."/docs/credits.txt";
my $content = ""; $request->push_handlers(PerlResponseHandler => sub {
open(my $FILE, "<", $config->getWebguiRoot."/docs/credits.txt"); $request->content_type('text/plain');
while (my $line = <$FILE>) { $request->sendfile($filename);
$content .= $line;
}
close($FILE);
$request->print($content);
return Apache2::Const::OK; return Apache2::Const::OK;
} ); });
$request->push_handlers(PerlTransHandler => sub { return Apache2::Const::OK }); $request->push_handlers(PerlTransHandler => sub { return Apache2::Const::OK });
$request->push_handlers(PerlMapToStorageHandler => sub { return Apache2::Const::OK });
return Apache2::Const::OK; return Apache2::Const::OK;
} }