couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [15/50] couch commit: updated refs/heads/master to 9d0ac7d
Date Thu, 28 Aug 2014 12:11:51 GMT
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-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/8b53ec22
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/8b53ec22
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/8b53ec22

Branch: refs/heads/master
Commit: 8b53ec2285d9ee8ce6c0ea5d7311f73d1aa83148
Parents: 25e4c7f
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Wed Dec 11 11:09:37 2013 -0600
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Aug 28 13:00:00 2014 +0100

----------------------------------------------------------------------
 src/couch_httpd_db.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/8b53ec22/src/couch_httpd_db.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_db.erl b/src/couch_httpd_db.erl
index 7360dc0..8689944 100644
--- a/src/couch_httpd_db.erl
+++ b/src/couch_httpd_db.erl
@@ -520,7 +520,7 @@ db_doc_req(#httpd{method = 'GET', mochi_req = MochiReq} = 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
@@ -663,7 +663,7 @@ send_docs_multipart(Req, Results, Options1) ->
              couch_httpd:send_chunk(Resp, <<"\r\n--", OuterBoundary/binary>>);
         ({{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,


Mime
View raw message