Apache2-Filter-Minifier-JavaScript
view release on metacpan or search on metacpan
1.03 Fri Sep 28 11:09 PDT 2007
- release; verified that changes in 1.03_01 for configuration requirements
worked as intended when doing CPANPLUS test runs
1.03_01 Thu Sep 27 13:27 PDT 2007
- rewrote Build.PL/Makefile.PL so they now check if you've got Apache::Test
installed -at-configuration-time-. If not, the build is aborted. One
day, CPAN(PLUS) et al. will support "configure_requires", but until then
we've got to check for this ourselves.
- fixed Content-Type filtering so that it now properly handles HTTP headers
that have additional attributes (e.g. "charset=...")
1.02 Wed Sep 26 1:25 PDT 2007
- added Makefile.PL, so CPANPLUS testers stop failing tests because they
don't have Module::Build installed
1.01 Fri Sep 21 13:31 PDT 2007
- added explicit dependency on MP2
- updated test requirements to "need_*" instead of "have_*"
1.00 Thu Sep 20 12:45 PDT 2007
t/MY/CharsetHandler.pm view on Meta::CPAN
use warnings;
use Apache2::RequestIO qw();
use Apache2::RequestRec qw();
use Apache2::RequestUtil qw();
use Apache2::Const -compile => qw(OK);
use File::Spec::Functions qw(catfile);
use File::Slurp qw(slurp);
sub handler {
my $r = shift;
$r->content_type('text/javascript; charset=iso-8859-1');
$r->print( slurp(catfile($r->document_root,'test.js')) );
return Apache2::Const::OK;
}
1;
t/conf/extra.conf.in view on Meta::CPAN
<Location /mimetypes/multiple>
SetHandler modperl
PerlResponseHandler MY::PlainHandler
PerlOutputFilterHandler Apache2::Filter::Minifier::JavaScript
PerlAddVar JsMimeType application/octet-stream
PerlAddVar JsMimeType text/plain
PerlAddVar JsMimeType text/json
</Location>
<Location /content-type/charset>
SetHandler modperl
PerlResponseHandler MY::CharsetHandler
PerlOutputFilterHandler Apache2::Filter::Minifier::JavaScript
</Location>
<Location /content-type/missing>
SetHandler modperl
PerlResponseHandler MY::NoCTypeHandler
PerlOutputFilterHandler Apache2::Filter::Minifier::JavaScript
</Location>
t/content-type.t view on Meta::CPAN
use warnings FATAL => 'all';
use if $ENV{AUTOMATED_TESTING}, 'Test::DiagINC'; use Apache::Test;
use Apache::TestRequest;
use Apache::TestUtil qw(t_cmp);
use lib 't';
use File::Slurp qw(slurp);
# Test "Content-Type" headers
plan tests => 2, need_lwp;
# "Content-Type" with additional attributes (e.g. "charset")
charset_minified: {
my $body = GET_BODY '/content-type/charset';
my $min = slurp( 't/htdocs/minified.txt' );
ok( t_cmp($body, $min) );
}
# Missing "Content-Type" header; should decline processing and we get the
# un-minified version.
content_type_missing: {
my $res = GET '/content-type/missing';
my $body = $res->content;
( run in 2.311 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )