aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-11-29 18:07:23 +0100
committerLoïc Hoguin <[email protected]>2017-11-29 18:07:23 +0100
commit37d069cd516448712c1793d376dfb4638ec41e6a (patch)
tree3cb6d294123366b7a1aa1952525d61a5bb32f5e4 /test
parentaea172857fe69ea4e9f3d5c74781df2f40381d7f (diff)
downloadcowboy-37d069cd516448712c1793d376dfb4638ec41e6a.tar.gz
cowboy-37d069cd516448712c1793d376dfb4638ec41e6a.tar.bz2
cowboy-37d069cd516448712c1793d376dfb4638ec41e6a.zip
Fix many rfc7230 tests that were echoing the URI
Diffstat (limited to 'test')
-rw-r--r--test/handlers/echo_h.erl2
-rw-r--r--test/rfc7230_SUITE.erl24
2 files changed, 13 insertions, 13 deletions
diff --git a/test/handlers/echo_h.erl b/test/handlers/echo_h.erl
index 04c3cf5..a2ab31b 100644
--- a/test/handlers/echo_h.erl
+++ b/test/handlers/echo_h.erl
@@ -50,7 +50,7 @@ echo(<<"uri">>, Req, Opts) ->
[<<"no-qs">>] -> cowboy_req:uri(Req, #{qs => undefined});
[<<"no-path">>] -> cowboy_req:uri(Req, #{path => undefined, qs => undefined});
[<<"set-port">>] -> cowboy_req:uri(Req, #{port => 123});
- [] -> cowboy_req:uri(Req)
+ _ -> cowboy_req:uri(Req)
end,
{ok, cowboy_req:reply(200, #{}, Value, Req), Opts};
echo(<<"match">>, Req, Opts) ->
diff --git a/test/rfc7230_SUITE.erl b/test/rfc7230_SUITE.erl
index b0b4777..05f70c4 100644
--- a/test/rfc7230_SUITE.erl
+++ b/test/rfc7230_SUITE.erl
@@ -244,18 +244,18 @@ reject_two_sp_between_method_and_request_target(Config) ->
ignore_uri_fragment_after_path(Config) ->
doc("The fragment part of the target URI is not sent. It must be "
"ignored by a server receiving it. (RFC7230 5.1)"),
- Echo = <<"http://localhost/echo/url">>,
+ Echo = <<"http://localhost/echo/uri">>,
#{code := 200, body := Echo} = do_raw(Config,
- "GET /echo/url#fragment HTTP/1.1\r\n"
+ "GET /echo/uri#fragment HTTP/1.1\r\n"
"Host: localhost\r\n"
"\r\n").
ignore_uri_fragment_after_query(Config) ->
doc("The fragment part of the target URI is not sent. It must be "
"ignored by a server receiving it. (RFC7230 5.1)"),
- Echo = <<"http://localhost/echo/url?key=value">>,
+ Echo = <<"http://localhost/echo/uri?key=value">>,
#{code := 200, body := Echo} = do_raw(Config,
- "GET /echo/url?key=value#fragment HTTP/1.1\r\n"
+ "GET /echo/uri?key=value#fragment HTTP/1.1\r\n"
"Host: localhost\r\n"
"\r\n").
@@ -282,9 +282,9 @@ origin_form_reject_if_connect(Config) ->
origin_form_tcp_scheme(Config) ->
doc("The scheme is either resolved from configuration or is \"https\" "
"when on a TLS connection and \"http\" otherwise. (RFC7230 5.5)"),
- Echo = <<"http://localhost/echo/url">>,
+ Echo = <<"http://localhost/echo/uri">>,
#{code := 200, body := Echo} = do_raw(Config,
- "GET /echo/url HTTP/1.1\r\n"
+ "GET /echo/uri HTTP/1.1\r\n"
"Host: localhost\r\n"
"\r\n").
@@ -344,17 +344,17 @@ must_understand_absolute_form(Config) ->
absolute_form_case_insensitive_scheme(Config) ->
doc("The scheme is case insensitive and normally provided in lowercase. (RFC7230 2.7.3)"),
- Echo = <<"http://localhost/echo/url">>,
+ Echo = <<"http://localhost/echo/uri">>,
#{code := 200, body := Echo} = do_raw(Config,
- "GET HttP://localhost/echo/url HTTP/1.1\r\n"
+ "GET HttP://localhost/echo/uri HTTP/1.1\r\n"
"Host: localhost\r\n"
"\r\n").
absolute_form_case_insensitive_host(Config) ->
doc("The host is case insensitive and normally provided in lowercase. (RFC7230 2.7.3)"),
- Echo = <<"http://localhost/echo/url">>,
+ Echo = <<"http://localhost/echo/uri">>,
#{code := 200, body := Echo} = do_raw(Config,
- "GET http://LoCaLHOsT/echo/url HTTP/1.1\r\n"
+ "GET http://LoCaLHOsT/echo/uri HTTP/1.1\r\n"
"Host: localhost\r\n"
"\r\n").
@@ -371,9 +371,9 @@ absolute_form_drop_scheme_tcp(Config) ->
doc("The scheme provided with the request must be dropped. The effective "
"scheme is either resolved from configuration or is \"https\" when on "
"a TLS connection and \"http\" otherwise. (RFC7230 5.5)"),
- Echo = <<"http://localhost/echo/url">>,
+ Echo = <<"http://localhost/echo/uri">>,
#{code := 200, body := Echo} = do_raw(Config,
- "GET https://localhost/echo/url HTTP/1.1\r\n"
+ "GET https://localhost/echo/uri HTTP/1.1\r\n"
"Host: localhost\r\n"
"\r\n").