0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Fix a bug in REST when allowed_methods is defined when method is OPTIONS

This commit is contained in:
Loïc Hoguin 2013-04-29 16:36:54 +02:00
parent 83e8ebb9ff
commit 68a365b85a

View file

@ -136,8 +136,7 @@ allowed_methods(Req, State=#state{method=Method}) ->
State2 = State#state{handler_state=HandlerState},
case lists:member(Method, List) of
true when Method =:= <<"OPTIONS">> ->
next(Req2, State2#state{allowed_methods=
[<<"HEAD">>, <<"GET">>, <<"OPTIONS">>]},
next(Req2, State2#state{allowed_methods=List},
fun malformed_request/2);
true ->
next(Req2, State2, fun malformed_request/2);