aboutsummaryrefslogtreecommitdiffstats
path: root/test/rfc7230_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-21 13:56:33 +0100
committerLoïc Hoguin <[email protected]>2018-11-21 14:06:57 +0100
commit84e474d2126118730813f85208ce443ac1343474 (patch)
tree8d3a544bd3905e2c0461dfb0cf6d7dd640c257d3 /test/rfc7230_SUITE.erl
parentdc52ebe4407ac917bbac127a9feae756b44ef940 (diff)
downloadcowboy-84e474d2126118730813f85208ce443ac1343474.tar.gz
cowboy-84e474d2126118730813f85208ce443ac1343474.tar.bz2
cowboy-84e474d2126118730813f85208ce443ac1343474.zip
Move one more old HTTP test case
Diffstat (limited to 'test/rfc7230_SUITE.erl')
-rw-r--r--test/rfc7230_SUITE.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/rfc7230_SUITE.erl b/test/rfc7230_SUITE.erl
index fbf4da9..6aefd8e 100644
--- a/test/rfc7230_SUITE.erl
+++ b/test/rfc7230_SUITE.erl
@@ -1459,6 +1459,22 @@ limit_requests_keepalive(Config) ->
{_, <<"close">>} = lists:keyfind(<<"connection">>, 1, RespHeaders),
gun_down(ConnPid).
+accept_at_least_1_empty_line_keepalive(Config) ->
+ doc("A configurable number of empty lines (CRLF) preceding the request "
+ "must be ignored. At least 1 empty line must be ignored. (RFC7230 3.5)"),
+ #{code := 200, client := Client} = do_raw(Config,
+ "GET / HTTP/1.1\r\n"
+ "Host: localhost\r\n"
+ "\r\n"
+ %% We send an extra CRLF that must be ignored.
+ "\r\n"),
+ ok = raw_send(Client,
+ "GET / HTTP/1.1\r\n"
+ "Host: localhost\r\n"
+ "\r\n"),
+ {'HTTP/1.1', 200, _, _} = cow_http:parse_status_line(raw_recv_head(Client)),
+ ok.
+
%skip_request_body_by_closing_connection(Config) ->
%%A server that doesn't want to read the entire body of a message
%%must close the connection, if possible after sending the "close"