From: Dagfinn Ilmari Mannsåker Date: Wed, 14 Mar 2018 11:56:08 +0000 (+0000) Subject: Use less-likely extension for unknown file type (RT#124211) X-Git-Tag: v0.35~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Plugin-Static-Simple.git;a=commitdiff_plain;h=360da246a035a3c09f12737a0ce061ed5914e41d Use less-likely extension for unknown file type (RT#124211) --- diff --git a/Changes b/Changes index 920dfe5..69b8219 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ Revision history for Perl extension Catalyst::Plugin::Static::Simple + - Use less-likely extension for unknown file type (RT#124211) + 0.34 2017-08-02 09:56 Los Angeles - Remove MYMETA.* (RT#108814) - Fix installing on 5.26.0+ (RT#121861) diff --git a/t/04static.t b/t/04static.t index b301341..931a435 100644 --- a/t/04static.t +++ b/t/04static.t @@ -30,7 +30,7 @@ ok( $res = request('http://localhost/files/404.txt'), 'request ok' ); is( $res->content, 'default', 'default handler for non-existent content ok' ); # test unknown extension -ok( $res = request('http://localhost/files/err.omg'), 'request ok' ); +ok( $res = request('http://localhost/files/err.unknown'), 'request ok' ); is( $res->content_type, 'text/plain', 'unknown extension as text/plain ok' ); ok( $res = request('http://localhost/files/empty.txt'), 'request ok' ); diff --git a/t/07mime_types.t b/t/07mime_types.t index e9276b0..06e3277 100644 --- a/t/07mime_types.t +++ b/t/07mime_types.t @@ -11,11 +11,11 @@ use Catalyst::Test 'TestApp'; # test custom MIME types TestApp->config->{'Plugin::Static::Simple'}->{mime_types} = { - omg => 'holy/crap', + unknown => 'holy/crap', gif => 'patents/are-evil', }; -ok( my $res = request('http://localhost/files/err.omg'), 'request ok' ); +ok( my $res = request('http://localhost/files/err.unknown'), 'request ok' ); is( $res->content_type, 'holy/crap', 'custom MIME type ok' ); ok( $res = request('http://localhost/files/bad.gif'), 'request ok' ); diff --git a/t/lib/TestApp/root/files/err.omg b/t/lib/TestApp/root/files/err.unknown similarity index 100% rename from t/lib/TestApp/root/files/err.omg rename to t/lib/TestApp/root/files/err.unknown