File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
lib/MetaCPAN/Server/Controller Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use warnings;
55
66use Moose;
77use Plack::App::Directory;
8+ use Plack::MIME;
89
910BEGIN { extends ' MetaCPAN::Server::Controller' }
1011
@@ -32,7 +33,7 @@ sub get : Chained('index') : PathPart('') : Args {
3233 }
3334 else {
3435 $c -> stash-> {path } = $file ;
35- $c -> res-> content_type(' text/plain' );
36+ $c -> res-> content_type(Plack::MIME -> mime_type( $file ) || ' text/plain' );
3637 $c -> res-> body( $file -> openr );
3738 }
3839}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ test_psgi app, sub {
2222 if ( $k eq ' /source/Moose' ) {
2323 like( $res -> content, qr / package Moose/ , ' Moose source' );
2424 is( $res -> header(' content-type' ),
25- ' text/plain ; charset=UTF-8' ,
25+ ' text/x-script.perl-module ; charset=UTF-8' ,
2626 ' Content-type'
2727 );
2828 }
You can’t perform that action at this time.
0 commit comments