aboutsummaryrefslogtreecommitdiffstats
path: root/test/rfc7230_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/rfc7230_SUITE.erl')
-rw-r--r--test/rfc7230_SUITE.erl19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/rfc7230_SUITE.erl b/test/rfc7230_SUITE.erl
index 0ef1690..fbf4da9 100644
--- a/test/rfc7230_SUITE.erl
+++ b/test/rfc7230_SUITE.erl
@@ -640,6 +640,15 @@ invalid_request_target(Config) ->
"\r\n"),
{error, closed} = raw_recv(Client, 0, 1000).
+missing_request_target(Config) ->
+ doc("The lack of request target must be rejected with a 400 status code "
+ "and the closing of the connection."),
+ #{code := 400, client := Client} = do_raw(Config,
+ "GET HTTP/1.1\r\n"
+ "Host: localhost\r\n"
+ "\r\n"),
+ {error, closed} = raw_recv(Client, 0, 1000).
+
%% Between request-target and version.
reject_tab_between_request_target_and_version(Config) ->
@@ -1641,6 +1650,16 @@ empty_host(Config0) ->
%%
%% This is covered in req_SUITE in the tests for cowboy_req:uri/1,2.
+reject_non_authoritative_host(Config) ->
+ doc("A request with a host header for which the origin server is "
+ "not authoritative must be rejected with a 400 status code. "
+ "(RFC7230 5.5, RFC7230 9.1)"),
+ #{code := 400} = do_raw(Config, [
+ "GET / HTTP/1.1\r\n"
+ "Host: ninenines.eu\r\n"
+ "\r\n"]),
+ ok.
+
%@todo
%Resources with identical URI except for the scheme component
%must be treated as different. (RFC7230 2.7.2)