Set utf-8 charset for raw logs

Also fix incorrect use of Content-Encoding header in View::Plain.
This commit is contained in:
Eelco Dolstra 2016-10-24 17:14:33 +02:00
parent 3fcfa20d1a
commit 140cbe9302
2 changed files with 2 additions and 3 deletions

View file

@ -9,7 +9,7 @@ sub process {
my $logPath = $c->stash->{logPath};
$c->response->content_type('text/plain');
$c->response->content_type('text/plain; charset=utf-8');
my $fh = new IO::Handle;

View file

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