Skip to content

Commit

Permalink
Leave template view json as a character string
Browse files Browse the repository at this point in the history
Catalyst will encode it.
  • Loading branch information
rwstauner committed Aug 27, 2015
1 parent 6dc5c9d commit 15e06bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/MetaCPAN/Web/View/HTML.pm
Expand Up @@ -90,7 +90,9 @@ Template::Alloy->define_vmethod( 'text',
Template::Alloy->define_vmethod(
'hash',
pretty_json => sub {
JSON::MaybeXS->new->utf8->pretty->encode(shift);

# Use utf8(0) because Catatlyst expects our view to be a character string.
JSON::MaybeXS->new->utf8(0)->pretty->encode(shift);
}
);

Expand Down

0 comments on commit 15e06bd

Please sign in to comment.