From 47895d920228edfb195e62ff04d5aa8ef667ed5b Mon Sep 17 00:00:00 2001 From: Noah Slater Date: Tue, 24 Feb 2009 18:10:19 +0000 Subject: added newline to JSON responses, closes COUCHDB-107 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@747465 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/couchdb') diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl index 9b175825..3365e88c 100644 --- a/src/couchdb/couch_httpd.erl +++ b/src/couchdb/couch_httpd.erl @@ -367,7 +367,8 @@ send_json(Req, Code, Headers, Value) -> {"Content-Type", negotiate_content_type(Req)}, {"Cache-Control", "must-revalidate"} ], - send_response(Req, Code, DefaultHeaders ++ Headers, ?JSON_ENCODE(Value)). + send_response(Req, Code, DefaultHeaders ++ Headers, + list_to_binary([?JSON_ENCODE(Value), $\n])). start_json_response(Req, Code) -> start_json_response(Req, Code, []). @@ -380,6 +381,7 @@ start_json_response(Req, Code, Headers) -> start_chunked_response(Req, Code, DefaultHeaders ++ Headers). end_json_response(Resp) -> + send_chunk(Resp, [$\n]), send_chunk(Resp, []). -- cgit v1.2.3