couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [32/50] chttpd commit: updated refs/heads/master to 58020ab
Date Thu, 28 Aug 2014 11:59:55 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-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/master
Commit: 3f3e916b0dad1f27d6762ded2f57a4bcd6067030
Parents: 50ccf29
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Wed Dec 11 11:11:52 2013 -0600
Committer: Robert Newson <rnewson@apache.org>
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,


Mime
View raw message