aboutsummaryrefslogtreecommitdiffstats
path: root/test/http_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-05-05 17:11:27 +0200
committerLoïc Hoguin <[email protected]>2011-05-05 17:11:27 +0200
commit470baff61f59321e2e246563a89664322e98df70 (patch)
treefd586a1779eaed5409797bbaf0516d16a22f2942 /test/http_SUITE.erl
parent29e71cf4daec684c13047952a95ec0dc9540aad5 (diff)
downloadcowboy-470baff61f59321e2e246563a89664322e98df70.tar.gz
cowboy-470baff61f59321e2e246563a89664322e98df70.tar.bz2
cowboy-470baff61f59321e2e246563a89664322e98df70.zip
Add headers_huge test, demonstrating issue #3 is fixed.
The previous commit switching to raw recv + erlang:decode_packet/3 works around the OTP bug regarding headers size in http recv.
Diffstat (limited to 'test/http_SUITE.erl')
-rw-r--r--test/http_SUITE.erl12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index c04c3d8..6b1a70f 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -18,7 +18,8 @@
-export([all/0, groups/0, init_per_suite/1, end_per_suite/1,
init_per_group/2, end_per_group/2]). %% ct.
--export([headers_dupe/1, nc_rand/1, pipeline/1, raw/1]). %% http.
+-export([headers_dupe/1, headers_huge/1,
+ nc_rand/1, pipeline/1, raw/1]). %% http.
-export([http_200/1, http_404/1, websocket/1]). %% http and https.
%% ct.
@@ -28,7 +29,8 @@ all() ->
groups() ->
BaseTests = [http_200, http_404],
- [{http, [], [headers_dupe, nc_rand, pipeline, raw, websocket] ++ BaseTests},
+ [{http, [], [headers_dupe, headers_huge,
+ nc_rand, pipeline, raw, websocket] ++ BaseTests},
{https, [], BaseTests}].
init_per_suite(Config) ->
@@ -100,6 +102,12 @@ headers_dupe(Config) ->
nomatch = binary:match(Data, <<"Connection: keep-alive">>),
ok = gen_tcp:close(Socket).
+headers_huge(Config) ->
+ Cookie = lists:flatten(["whatever_man_biiiiiiiiiiiig_cookie_me_want_77="
+ "Wed Apr 06 2011 10:38:52 GMT-0500 (CDT)" || _N <- lists:seq(1, 1000)]),
+ {_Packet, 200} = raw_req(["GET / HTTP/1.0\r\nHost: localhost\r\n"
+ "Set-Cookie: ", Cookie, "\r\n\r\n"], Config).
+
nc_rand(Config) ->
Cat = os:find_executable("cat"),
Nc = os:find_executable("nc"),