diff options
author | Loïc Hoguin <[email protected]> | 2012-09-20 06:22:51 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2012-09-21 08:54:57 +0200 |
commit | 8497c8bbcdcfd8754c500e65557ee09d9bd1bed0 (patch) | |
tree | 76abb26e328b916addb95db4778f0666a1a7d4fb /src/cowboy_static.erl | |
parent | f6791b008ac8ccaa331bfbae9afb69af5bf36a7a (diff) | |
download | cowboy-8497c8bbcdcfd8754c500e65557ee09d9bd1bed0.tar.gz cowboy-8497c8bbcdcfd8754c500e65557ee09d9bd1bed0.tar.bz2 cowboy-8497c8bbcdcfd8754c500e65557ee09d9bd1bed0.zip |
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.
Diffstat (limited to 'src/cowboy_static.erl')
-rw-r--r-- | src/cowboy_static.erl | 4 |
1 files changed, 2 insertions, 2 deletions
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{}) |