mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Fix a bug in REST when allowed_methods is defined when method is OPTIONS
This commit is contained in:
parent
83e8ebb9ff
commit
68a365b85a
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue