Serve directories and symlinks correctly

This commit is contained in:
Eelco Dolstra
2017-11-14 17:15:05 +01:00
parent 100249c066
commit 7857f83251
2 changed files with 61 additions and 18 deletions

View File

@ -6,7 +6,8 @@ use base 'Catalyst::View::Download::Plain';
sub process {
my ($self, $c) = @_;
$c->response->content_type('text/plain; charset=utf-8') unless $c->response->content_type() ne "";
$c->clear_encoding;
$c->response->content_type('text/plain; charset=utf-8') if $c->response->content_type() eq "text/plain";
$c->response->body($c->stash->{plain}->{data});
}