0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 04:30:25 +00:00

Don't accept TRACE or CONNECT methods by default in REST

For the simple reason that the REST code does nothing about
them.
This commit is contained in:
Loïc Hoguin 2013-04-11 21:25:35 +02:00
parent 5a171d0f80
commit ae45cecfcd

View file

@ -96,9 +96,8 @@ known_methods(Req, State=#state{method=Method}) ->
case call(Req, State, known_methods) of case call(Req, State, known_methods) of
no_call when Method =:= <<"HEAD">>; Method =:= <<"GET">>; no_call when Method =:= <<"HEAD">>; Method =:= <<"GET">>;
Method =:= <<"POST">>; Method =:= <<"PUT">>; Method =:= <<"POST">>; Method =:= <<"PUT">>;
Method =:= <<"DELETE">>; Method =:= <<"TRACE">>; Method =:= <<"PATCH">>; Method =:= <<"DELETE">>;
Method =:= <<"CONNECT">>; Method =:= <<"OPTIONS">>; Method =:= <<"OPTIONS">> ->
Method =:= <<"PATCH">> ->
next(Req, State, fun uri_too_long/2); next(Req, State, fun uri_too_long/2);
no_call -> no_call ->
next(Req, State, 501); next(Req, State, 501);