mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
Add cowboy_http_req:set_resp_body_fun/3 to rest
This commit is contained in:
parent
937a2b0326
commit
f56479ffc2
1 changed files with 6 additions and 1 deletions
|
@ -748,7 +748,12 @@ set_resp_body(Req=#http_req{method=Method},
|
||||||
case call(Req5, State4, Fun) of
|
case call(Req5, State4, Fun) of
|
||||||
{Body, Req6, HandlerState} ->
|
{Body, Req6, HandlerState} ->
|
||||||
State5 = State4#state{handler_state=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)
|
multiple_choices(Req7, State5)
|
||||||
end;
|
end;
|
||||||
set_resp_body(Req, State) ->
|
set_resp_body(Req, State) ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue