From 68a365b85ad90cfba8755dcaa9aa6d9c8aecf800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 29 Apr 2013 16:36:54 +0200 Subject: Fix a bug in REST when allowed_methods is defined when method is OPTIONS --- src/cowboy_rest.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/cowboy_rest.erl') 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); -- cgit v1.2.3