0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Don't use decode_packet/3 for parsing the request-line

First step in making all methods and header names binaries to
get rid of many inconsistencies caused by decode_packet/3.

Methods are all binary now. Note that since they are case
sensitive, the usual methods become <<"GET">>, <<"POST">> and so on.
This commit is contained in:
Loïc Hoguin 2012-09-20 06:22:51 +02:00
parent f6791b008a
commit 8497c8bbcd
10 changed files with 147 additions and 107 deletions

View file

@ -247,9 +247,9 @@ rest_init(Req, Opts) ->
%% @private Only allow GET and HEAD requests on files.
-spec allowed_methods(Req, #state{})
-> {[atom()], Req, #state{}} when Req::cowboy_req:req().
-> {[binary()], Req, #state{}} when Req::cowboy_req:req().
allowed_methods(Req, State) ->
{['GET', 'HEAD'], Req, State}.
{[<<"GET">>, <<"HEAD">>], Req, State}.
%% @private
-spec malformed_request(Req, #state{})