aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-01-23 07:23:44 +0100
committerLoïc Hoguin <[email protected]>2012-01-23 07:37:49 +0100
commitb650ef8907355bc0223c2e7412e36c1a07cb0173 (patch)
tree08866d287798acbb60605746534fca2b09f3bda7 /src/cowboy_http_protocol.erl
parente68bbfac3455d4062c414cc0d3a785a80c4ac148 (diff)
parent528507c7decb2bf2fcbb55a47256011c2ce4bd4b (diff)
downloadcowboy-b650ef8907355bc0223c2e7412e36c1a07cb0173.tar.gz
cowboy-b650ef8907355bc0223c2e7412e36c1a07cb0173.tar.bz2
cowboy-b650ef8907355bc0223c2e7412e36c1a07cb0173.zip
Merge branch 'multipart' of https://github.com/nox/cowboy
Conflicts: src/cowboy_http_req.erl test/http_SUITE.erl
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r--src/cowboy_http_protocol.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl
index ea59799..cd951d1 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -380,7 +380,10 @@ ensure_body_processed(Req=#http_req{body_state=waiting}) ->
{error, badarg} -> ok; %% No body.
{error, _Reason} -> close;
_Any -> ok
- end.
+ end;
+ensure_body_processed(Req=#http_req{body_state={multipart, _, _}}) ->
+ {ok, Req2} = cowboy_http_req:multipart_skip(Req),
+ ensure_body_processed(Req2).
-spec ensure_response(#http_req{}) -> ok.
%% The handler has already fully replied to the client.