0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 12:40:25 +00:00

Fixes invalid type specification for cowboy_http_req:multipart_data/1

This commit is contained in:
Yurii Rashkovskii 2012-05-04 09:33:55 -07:00
parent 14b45fd8a9
commit d495582029

View file

@ -563,14 +563,14 @@ body_qs(Req=#http_req{urldecode={URLDecFun, URLDecArg}}) ->
%% %%
%% Use this function for multipart streaming. For each part in the request, %% Use this function for multipart streaming. For each part in the request,
%% this function returns <em>{headers, Headers}</em> followed by a sequence of %% this function returns <em>{headers, Headers}</em> followed by a sequence of
%% <em>{data, Data}</em> tuples and finally <em>end_of_part</em>. When there %% <em>{body, Data}</em> tuples and finally <em>end_of_part</em>. When there
%% is no part to parse anymore, <em>eof</em> is returned. %% is no part to parse anymore, <em>eof</em> is returned.
%% %%
%% If the request Content-Type is not a multipart one, <em>{error, badarg}</em> %% If the request Content-Type is not a multipart one, <em>{error, badarg}</em>
%% is returned. %% is returned.
-spec multipart_data(#http_req{}) -spec multipart_data(#http_req{})
-> {{headers, cowboy_http:headers()} -> {{headers, cowboy_http:headers()}
| {data, binary()} | end_of_part | eof, | {body, binary()} | end_of_part | eof,
#http_req{}}. #http_req{}}.
multipart_data(Req=#http_req{body_state=waiting}) -> multipart_data(Req=#http_req{body_state=waiting}) ->
{{<<"multipart">>, _SubType, Params}, Req2} = {{<<"multipart">>, _SubType, Params}, Req2} =