summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2018-02-09 10:15:24 +0100
committerYorhel <git@yorhel.nl>2018-02-09 10:15:27 +0100
commitb0cf1fecb95515faa56de655f85bf7729010fcb6 (patch)
treea70776d2cf71dff32edcd6cf41b8087095b8d68f
parent39ec19f50ed1e99e7ea174bbbd7f47bda53367eb (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.
-rw-r--r--lib/TUWF/Response.pm3
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));
}