summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_rep_httpc.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb/couch_rep_httpc.erl')
-rw-r--r--src/couchdb/couch_rep_httpc.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/couchdb/couch_rep_httpc.erl b/src/couchdb/couch_rep_httpc.erl
index 8cc3cae6..3e3b5f05 100644
--- a/src/couchdb/couch_rep_httpc.erl
+++ b/src/couchdb/couch_rep_httpc.erl
@@ -39,7 +39,14 @@ do_request(Req) ->
{OAuthProps} ->
[oauth_header(Url, Method, OAuthProps) | Headers0]
end,
- Body = if B =:= nil -> []; true -> iolist_to_binary(?JSON_ENCODE(B)) end,
+ Body = case B of
+ {Fun, InitialState} when is_function(Fun) ->
+ {Fun, InitialState};
+ nil ->
+ [];
+ _Else ->
+ iolist_to_binary(?JSON_ENCODE(B))
+ end,
Resp = case Conn of
nil ->
ibrowse:send_req(Url, Headers, Method, Body, Opts, infinity);