aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-09-20 06:22:51 +0200
committerLoïc Hoguin <[email protected]>2012-09-21 08:54:57 +0200
commit8497c8bbcdcfd8754c500e65557ee09d9bd1bed0 (patch)
tree76abb26e328b916addb95db4778f0666a1a7d4fb /test
parentf6791b008ac8ccaa331bfbae9afb69af5bf36a7a (diff)
downloadcowboy-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 'test')
-rw-r--r--test/http_SUITE.erl22
-rw-r--r--test/rest_forbidden_resource.erl2
-rw-r--r--test/rest_nodelete_resource.erl2
3 files changed, 13 insertions, 13 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index 1140cf9..af1e9cd 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -327,17 +327,17 @@ check_raw_status(Config) ->
HugeCookie = lists:flatten(["whatever_man_biiiiiiiiiiiig_cookie_me_want_77="
"Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)" || _ <- lists:seq(1, 40)]),
ResponsePacket =
-"HTTP/1.0 302 Found
-Location: http://www.google.co.il/
-Cache-Control: private
-Content-Type: text/html; charset=UTF-8
-Set-Cookie: PREF=ID=568f67013d4a7afa:FF=0:TM=1323014101:LM=1323014101:S=XqctDWC65MzKT0zC; expires=Tue, 03-Dec-2013 15:55:01 GMT; path=/; domain=.google.com
-Date: Sun, 04 Dec 2011 15:55:01 GMT
-Server: gws
-Content-Length: 221
-X-XSS-Protection: 1; mode=block
-X-Frame-Options: SAMEORIGIN
-
+"HTTP/1.0 302 Found\r
+Location: http://www.google.co.il/\r
+Cache-Control: private\r
+Content-Type: text/html; charset=UTF-8\r
+Set-Cookie: PREF=ID=568f67013d4a7afa:FF=0:TM=1323014101:LM=1323014101:S=XqctDWC65MzKT0zC; expires=Tue, 03-Dec-2013 15:55:01 GMT; path=/; domain=.google.com\r
+Date: Sun, 04 Dec 2011 15:55:01 GMT\r
+Server: gws\r
+Content-Length: 221\r
+X-XSS-Protection: 1; mode=block\r
+X-Frame-Options: SAMEORIGIN\r
+\r
<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
diff --git a/test/rest_forbidden_resource.erl b/test/rest_forbidden_resource.erl
index d34e7b2..63aac7e 100644
--- a/test/rest_forbidden_resource.erl
+++ b/test/rest_forbidden_resource.erl
@@ -10,7 +10,7 @@ rest_init(Req, [Forbidden]) ->
{ok, Req, Forbidden}.
allowed_methods(Req, State) ->
- {['GET', 'HEAD', 'POST'], Req, State}.
+ {[<<"GET">>, <<"HEAD">>, <<"POST">>], Req, State}.
forbidden(Req, State=true) ->
{true, Req, State};
diff --git a/test/rest_nodelete_resource.erl b/test/rest_nodelete_resource.erl
index 8c83422..9f9670c 100644
--- a/test/rest_nodelete_resource.erl
+++ b/test/rest_nodelete_resource.erl
@@ -6,7 +6,7 @@ init(_Transport, _Req, _Opts) ->
{upgrade, protocol, cowboy_rest}.
allowed_methods(Req, State) ->
- {['GET', 'HEAD', 'DELETE'], Req, State}.
+ {[<<"GET">>, <<"HEAD">>, <<"DELETE">>], Req, State}.
content_types_provided(Req, State) ->