Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 381FA11265 for ; Fri, 1 Aug 2014 09:05:56 +0000 (UTC) Received: (qmail 91358 invoked by uid 500); 1 Aug 2014 09:05:39 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 91270 invoked by uid 500); 1 Aug 2014 09:05:39 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 89970 invoked by uid 99); 1 Aug 2014 09:05:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2014 09:05:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 845EE9BC9E2; Fri, 1 Aug 2014 09:05:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rnewson@apache.org To: commits@couchdb.apache.org Date: Fri, 01 Aug 2014 09:06:11 -0000 Message-Id: In-Reply-To: <43199eadd1da472cb38a627f6bbae6bf@git.apache.org> References: <43199eadd1da472cb38a627f6bbae6bf@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [35/49] chttpd commit: updated refs/heads/windsor-merge to 554ef74 Fix JSON encoding for missing revisions This is a super old bug from when we switched to Jiffy. Jiffy doesn't support Erlang strings as object keys due to Unicode issues. This just changes the "missing" string to a <<"missing">> binary. BugzId: 26050 Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/3f3e916b Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/3f3e916b Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/3f3e916b Branch: refs/heads/windsor-merge Commit: 3f3e916b0dad1f27d6762ded2f57a4bcd6067030 Parents: 50ccf29 Author: Paul J. Davis Authored: Wed Dec 11 11:11:52 2013 -0600 Committer: Robert Newson Committed: Thu Jul 31 11:54:29 2014 +0100 ---------------------------------------------------------------------- src/chttpd_db.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/3f3e916b/src/chttpd_db.erl ---------------------------------------------------------------------- diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl index 7a1d69d..8491004 100644 --- a/src/chttpd_db.erl +++ b/src/chttpd_db.erl @@ -588,7 +588,7 @@ db_doc_req(#httpd{method='GET'}=Req, Db, DocId) -> send_chunk(Resp, AccSeparator ++ Json); {{not_found, missing}, RevId} -> RevStr = couch_doc:rev_to_str(RevId), - Json = ?JSON_ENCODE({[{"missing", RevStr}]}), + Json = ?JSON_ENCODE({[{<<"missing">>, RevStr}]}), send_chunk(Resp, AccSeparator ++ Json) end, "," % AccSeparator now has a comma @@ -795,7 +795,7 @@ send_docs_multipart(Req, Results, Options1) -> end; ({{not_found, missing}, RevId}) -> RevStr = couch_doc:rev_to_str(RevId), - Json = ?JSON_ENCODE({[{"missing", RevStr}]}), + Json = ?JSON_ENCODE({[{<<"missing">>, RevStr}]}), couch_httpd:send_chunk(Resp, [<<"\r\nContent-Type: application/json; error=\"true\"\r\n\r\n">>, Json,