aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/old_http_SUITE.erl29
-rw-r--r--test/rfc7230_SUITE.erl25
2 files changed, 24 insertions, 30 deletions
diff --git a/test/old_http_SUITE.erl b/test/old_http_SUITE.erl
index f1b88a4..f3150eb 100644
--- a/test/old_http_SUITE.erl
+++ b/test/old_http_SUITE.erl
@@ -123,24 +123,6 @@ check_raw_status(Config) ->
Huge = [$0 || _ <- lists:seq(1, 5000)],
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\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>
-The document has moved
-<A HREF=\"http://www.google.co.il/\">here</A>.
-</BODY></HTML>",
Tests = [
{200, ["GET / HTTP/1.0\r\nHost: localhost\r\n"
"Set-Cookie: ", HugeCookie, "\r\n\r\n"]},
@@ -153,15 +135,7 @@ The document has moved
{400, "GET / HTTP/1.1\r\nHost: ninenines.eu\r\n\r\n"},
{400, "GET http://proxy/ HTTP/1.1\r\n\r\n"},
{400, "GET / HTTP/1.1\r\nHost: localhost:bad_port\r\n\r\n"},
- {400, ResponsePacket},
- {408, "GET / HTTP/1.1\r\nHost: localhost"},
- {408, "GET / HTTP/1.1\r\nHost: localhost\r\n"},
- {408, "GET / HTTP/1.1\r\nHost: localhost\r\n\r"},
- {closed, Huge},
- {closed, ""},
- {closed, "\r\n"},
- {closed, "\r\n\r\n"},
- {closed, "GET / HTTP/1.1"}
+ {closed, Huge}
],
_ = [{Status, Packet} = begin
Ret = do_raw(Packet, Config),
@@ -171,7 +145,6 @@ The document has moved
check_status(Config) ->
Tests = [
- {200, "/"},
{200, "/simple"},
{404, "/not/found"},
{500, "/handler_errors?case=init_before_reply"}
diff --git a/test/rfc7230_SUITE.erl b/test/rfc7230_SUITE.erl
index d680d75..e8f2df8 100644
--- a/test/rfc7230_SUITE.erl
+++ b/test/rfc7230_SUITE.erl
@@ -148,8 +148,29 @@ timeout_after_request_line(Config) ->
doc("The time the request (request line and headers) takes to be "
"received by the server must be limited and subject to configuration. "
"A 408 status code must be sent if the request line was received."),
- #{code := 408, client := Client} = do_raw(Config, "GET / HTTP/1.1\r\n"),
- {error, closed} = raw_recv(Client, 0, 6000).
+ #{code := 408, client := Client1} = do_raw(Config, "GET / HTTP/1.1\r\n"),
+ {error, closed} = raw_recv(Client1, 0, 6000).
+
+timeout_after_request_line_host(Config) ->
+ doc("The time the request (request line and headers) takes to be "
+ "received by the server must be limited and subject to configuration. "
+ "A 408 status code must be sent if the request line was received."),
+ #{code := 408, client := Client2} = do_raw(Config, "GET / HTTP/1.1\r\nHost: localhost"),
+ {error, closed} = raw_recv(Client2, 0, 6000).
+
+timeout_after_request_line_host_crlf(Config) ->
+ doc("The time the request (request line and headers) takes to be "
+ "received by the server must be limited and subject to configuration. "
+ "A 408 status code must be sent if the request line was received."),
+ #{code := 408, client := Client3} = do_raw(Config, "GET / HTTP/1.1\r\nHost: localhost\r\n"),
+ {error, closed} = raw_recv(Client3, 0, 6000).
+
+timeout_after_request_line_host_crlfcr(Config) ->
+ doc("The time the request (request line and headers) takes to be "
+ "received by the server must be limited and subject to configuration. "
+ "A 408 status code must be sent if the request line was received."),
+ #{code := 408, client := Client4} = do_raw(Config, "GET / HTTP/1.1\r\nHost: localhost\r\n\r"),
+ {error, closed} = raw_recv(Client4, 0, 6000).
%% @todo Add an HTTP/1.0 test suite.
%An HTTP/1.1 server must understand any valid HTTP/1.0 request,