aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2011-11-08 00:51:49 +0100
committerLoïc Hoguin <[email protected]>2012-01-23 07:20:35 +0100
commit528507c7decb2bf2fcbb55a47256011c2ce4bd4b (patch)
tree14966540ecf17499d1d3e161c5690f5de4fbbf0d /src/cowboy_http_protocol.erl
parenta5b47fda8de7972c9affb4f4d1320fb666c67a92 (diff)
downloadcowboy-528507c7decb2bf2fcbb55a47256011c2ce4bd4b.tar.gz
cowboy-528507c7decb2bf2fcbb55a47256011c2ce4bd4b.tar.bz2
cowboy-528507c7decb2bf2fcbb55a47256011c2ce4bd4b.zip
Add multipart support
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 b0ee590..c76c607 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -350,7 +350,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.