diff options
author | Loïc Hoguin <[email protected]> | 2013-02-06 18:35:07 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-02-06 18:35:52 +0100 |
commit | 4e71cd0f14f6f4c617079aa614e65b88f6308727 (patch) | |
tree | df6f6836c44c8971edfc6f7d16b386c9558a5c2b /src | |
parent | 60e94237c23bb339f13c9df4fac11e7a57a082f1 (diff) | |
parent | 29c4508884f4e70dc23f486da64aee491009b124 (diff) | |
download | cowboy-4e71cd0f14f6f4c617079aa614e65b88f6308727.tar.gz cowboy-4e71cd0f14f6f4c617079aa614e65b88f6308727.tar.bz2 cowboy-4e71cd0f14f6f4c617079aa614e65b88f6308727.zip |
Merge branch 'master' of git://github.com/tsloughter/cowboy
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_req.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl index 0745192..eb3a939 100644 --- a/src/cowboy_req.erl +++ b/src/cowboy_req.erl @@ -847,7 +847,7 @@ set_resp_body(Body, Req) -> %% Cowboy will add a "Transfer-Encoding: identity" header to the %% response. -spec set_resp_body_fun(resp_body_fun(), Req) -> Req when Req::req(). -set_resp_body_fun(StreamFun, Req) -> +set_resp_body_fun(StreamFun, Req) when is_function(StreamFun) -> Req#http_req{resp_body=StreamFun}. %% @doc Add a body function to the response. @@ -863,7 +863,8 @@ set_resp_body_fun(StreamFun, Req) -> %% fewer bytes than declared the behaviour is undefined. -spec set_resp_body_fun(non_neg_integer(), resp_body_fun(), Req) -> Req when Req::req(). -set_resp_body_fun(StreamLen, StreamFun, Req) -> +set_resp_body_fun(StreamLen, StreamFun, Req) + when is_integer(StreamLen), is_function(StreamFun) -> Req#http_req{resp_body={StreamLen, StreamFun}}. %% @doc Return whether the given header has been set for the response. |