diff options
author | Loïc Hoguin <[email protected]> | 2013-04-29 16:36:54 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-04-29 16:36:54 +0200 |
commit | 68a365b85ad90cfba8755dcaa9aa6d9c8aecf800 (patch) | |
tree | fcc8f5f4a8d8e42866f5caf0320e3d12f428823b | |
parent | 83e8ebb9ff832017dd2d0fb6188e8e8a5602ff9c (diff) | |
download | cowboy-68a365b85ad90cfba8755dcaa9aa6d9c8aecf800.tar.gz cowboy-68a365b85ad90cfba8755dcaa9aa6d9c8aecf800.tar.bz2 cowboy-68a365b85ad90cfba8755dcaa9aa6d9c8aecf800.zip |
Fix a bug in REST when allowed_methods is defined when method is OPTIONS
-rw-r--r-- | src/cowboy_rest.erl | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl index d3e8d7e..b44ccef 100644 --- a/src/cowboy_rest.erl +++ b/src/cowboy_rest.erl @@ -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); |