diff options
author | Yorhel <git@yorhel.nl> | 2018-02-09 10:15:24 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2018-02-09 10:15:27 +0100 |
commit | b0cf1fecb95515faa56de655f85bf7729010fcb6 (patch) | |
tree | a70776d2cf71dff32edcd6cf41b8087095b8d68f /lib | |
parent | 39ec19f50ed1e99e7ea174bbbd7f47bda53367eb (diff) |
resJSON: Fix double UTF-8 encoding
JSON::XS::encode_json() already does UTF-8 encoding for us, so we need
to treat its return value as binary.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/TUWF/Response.pm | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/TUWF/Response.pm b/lib/TUWF/Response.pm index 34754e8..07799e8 100644 --- a/lib/TUWF/Response.pm +++ b/lib/TUWF/Response.pm @@ -192,8 +192,7 @@ sub resJSON { $self->resHeader('Content-Type' => 'application/json; charset=UTF-8'); $self->resBuffer('clear'); - my $fd = $self->resFd(); - print $fd JSON::XS::encode_json($obj); + $self->resBinary(JSON::XS::encode_json($obj)); } |