From eded22d1aa18f3d20d6d84b753ae0134f642665a Mon Sep 17 00:00:00 2001 From: geeksilva97 Date: Tue, 6 Feb 2024 10:16:56 -0300 Subject: [PATCH] unify case clauses --- src/cowboy_rest.erl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl index e9e49811..b9f091f9 100644 --- a/src/cowboy_rest.erl +++ b/src/cowboy_rest.erl @@ -332,11 +332,7 @@ stringify_allowed_methods(MethodList) when is_list(MethodList) -> allowed_methods(Req, State=#state{method=Method}) -> DefaultAllowedMethods = [<<"HEAD">>, <<"GET">>, <<"OPTIONS">>], case call(Req, State, allowed_methods) of - no_call when Method =:= <<"HEAD">>; Method =:= <<"GET">> -> - Allow = stringify_allowed_methods(DefaultAllowedMethods), - Req2 = cowboy_req:set_resp_header(<<"allow">>, Allow, Req), - next(Req2, State, fun malformed_request/2); - no_call when Method =:= <<"OPTIONS">> -> + no_call when Method =:= <<"HEAD">>; Method =:= <<"GET">>; Method =:= <<"OPTIONS">> -> Allow = stringify_allowed_methods(DefaultAllowedMethods), Req2 = cowboy_req:set_resp_header(<<"allow">>, Allow, Req), next(Req2, State, fun malformed_request/2);