Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #80 from cloudant/12833-conditional_json_encode
Browse files Browse the repository at this point in the history
  • Loading branch information
kocolosk committed Nov 9, 2011
2 parents 4216ca2 + 6ad4258 commit 0b2c8fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/couch/src/couch_rep.erl
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,8 @@ ensure_full_commit(#http_db{headers = Headers} = Source, RequiredSeq) ->
Req = Source#http_db{
resource = "_ensure_full_commit",
method = post,
qs = [{seq, iolist_to_binary(?JSON_ENCODE(RequiredSeq))}],
qs = [{seq, case RequiredSeq of Bin when is_binary(Bin) -> Bin;
Else -> iolist_to_binary(?JSON_ENCODE(Else)) end}],
headers = Headers1
},
{ResultProps} = couch_rep_httpc:request(Req),
Expand Down
3 changes: 2 additions & 1 deletion apps/couch/src/couch_rep_changes_feed.erl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ init([Parent, #http_db{headers = Headers0} = Source, Since, PostProps]) ->
BaseQS = [
{"style", all_docs},
{"heartbeat", 10000},
{"since", iolist_to_binary(?JSON_ENCODE(Since))},
{"since", case Since of Bin when is_binary(Bin) -> Bin;
Else -> iolist_to_binary(?JSON_ENCODE(Else)) end},
{"feed", Feed}
],
{QS, Method, Body, Headers} = case get_value(<<"doc_ids">>, PostProps) of
Expand Down

0 comments on commit 0b2c8fb

Please sign in to comment.