From 8497c8bbcdcfd8754c500e65557ee09d9bd1bed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 20 Sep 2012 06:22:51 +0200 Subject: 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. --- src/cowboy_static.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cowboy_static.erl') diff --git a/src/cowboy_static.erl b/src/cowboy_static.erl index aaf798c..5450115 100644 --- a/src/cowboy_static.erl +++ b/src/cowboy_static.erl @@ -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{}) -- cgit v1.2.3