aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-05-06 11:33:27 +0300
committerLoïc Hoguin <[email protected]>2015-05-06 11:33:27 +0300
commit4fb2aacc8880236d456a85fe41f0363c02110ed5 (patch)
tree59ca1e48e6151d448003f6d82e8fa7dfc64ae5f9 /src
parent1d99878561f235dfa9946db3be92723ebe8f93eb (diff)
parentaa2d41951a97233f96838a5d0facf53df0bc6319 (diff)
downloadcowboy-4fb2aacc8880236d456a85fe41f0363c02110ed5.tar.gz
cowboy-4fb2aacc8880236d456a85fe41f0363c02110ed5.tar.bz2
cowboy-4fb2aacc8880236d456a85fe41f0363c02110ed5.zip
Merge branch 'fix-1' of https://github.com/martinrehfeld/cowboy into 1.0.x
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_http.erl4
-rw-r--r--src/cowboy_rest.erl8
2 files changed, 9 insertions, 3 deletions
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl
index 1cf73bf..d616f73 100644
--- a/src/cowboy_http.erl
+++ b/src/cowboy_http.erl
@@ -668,7 +668,9 @@ token(<< C, Rest/binary >>, Fun, Case, Acc) ->
-spec quoted_string(binary(), fun()) -> any().
quoted_string(<< $", Rest/binary >>, Fun) ->
- quoted_string(Rest, Fun, <<>>).
+ quoted_string(Rest, Fun, <<>>);
+quoted_string(_, _Fun) ->
+ {error, badarg}.
-spec quoted_string(binary(), fun(), binary()) -> any().
quoted_string(<<>>, _Fun, _Acc) ->
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl
index f779612..321b609 100644
--- a/src/cowboy_rest.erl
+++ b/src/cowboy_rest.erl
@@ -529,7 +529,9 @@ if_match_exists(Req, State) ->
{ok, '*', Req2} ->
if_unmodified_since_exists(Req2, State2);
{ok, ETagsList, Req2} ->
- if_match(Req2, State2, ETagsList)
+ if_match(Req2, State2, ETagsList);
+ {error, badarg} ->
+ respond(Req, State2, 400)
end.
if_match(Req, State, EtagsList) ->
@@ -579,7 +581,9 @@ if_none_match_exists(Req, State) ->
{ok, '*', Req2} ->
precondition_is_head_get(Req2, State);
{ok, EtagsList, Req2} ->
- if_none_match(Req2, State, EtagsList)
+ if_none_match(Req2, State, EtagsList);
+ {error, badarg} ->
+ respond(Req, State, 400)
end.
if_none_match(Req, State, EtagsList) ->