aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Klaar <[email protected]>2011-12-28 18:01:21 +0100
committerMagnus Klaar <[email protected]>2011-12-28 18:17:15 +0100
commitf56479ffc22ca421d50ab951db0b91c34d6e3acd (patch)
tree9d985601de90a9c7aba7b25dae40fea334f3ad0c
parent937a2b03260a86b915a128fbbdf3b88a8a76cc3f (diff)
downloadcowboy-f56479ffc22ca421d50ab951db0b91c34d6e3acd.tar.gz
cowboy-f56479ffc22ca421d50ab951db0b91c34d6e3acd.tar.bz2
cowboy-f56479ffc22ca421d50ab951db0b91c34d6e3acd.zip
Add cowboy_http_req:set_resp_body_fun/3 to rest
-rw-r--r--src/cowboy_http_rest.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cowboy_http_rest.erl b/src/cowboy_http_rest.erl
index e825a98..a5333fe 100644
--- a/src/cowboy_http_rest.erl
+++ b/src/cowboy_http_rest.erl
@@ -748,7 +748,12 @@ set_resp_body(Req=#http_req{method=Method},
case call(Req5, State4, Fun) of
{Body, Req6, HandlerState} ->
State5 = State4#state{handler_state=HandlerState},
- {ok, Req7} = cowboy_http_req:set_resp_body(Body, Req6),
+ {ok, Req7} = case Body of
+ {stream, Len, Fun1} ->
+ cowboy_http_req:set_resp_body_fun(Len, Fun1, Req6);
+ _Contents ->
+ cowboy_http_req:set_resp_body(Body, Req6)
+ end,
multiple_choices(Req7, State5)
end;
set_resp_body(Req, State) ->