aboutsummaryrefslogtreecommitdiffstats
path: root/test/rfc7230_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-12-06 14:05:30 +0100
committerLoïc Hoguin <[email protected]>2017-12-06 14:05:30 +0100
commitbc39b433bb20c44690b75bf28539983517002268 (patch)
treec335c45a92f535d2100d04f8a9df8899f459b013 /test/rfc7230_SUITE.erl
parent2eb3e3f994e464ae2678f7c3d321213e5eec9ad4 (diff)
downloadcowboy-bc39b433bb20c44690b75bf28539983517002268.tar.gz
cowboy-bc39b433bb20c44690b75bf28539983517002268.tar.bz2
cowboy-bc39b433bb20c44690b75bf28539983517002268.zip
Properly handle OPTIONS * requests
Support for these was broken during the development of Cowboy 2.0. It is now fixed and better handled than it ever was.
Diffstat (limited to 'test/rfc7230_SUITE.erl')
-rw-r--r--test/rfc7230_SUITE.erl21
1 files changed, 6 insertions, 15 deletions
diff --git a/test/rfc7230_SUITE.erl b/test/rfc7230_SUITE.erl
index 9175fa9..d680d75 100644
--- a/test/rfc7230_SUITE.erl
+++ b/test/rfc7230_SUITE.erl
@@ -41,9 +41,8 @@ init_routes(_) -> [
{"/echo/:key[/:arg]", echo_h, []},
{"/length/echo/:key", echo_h, []},
{"/resp/:key[/:arg]", resp_h, []},
- {"/send_message", send_message_h, []}
-%% @todo Something is clearly wrong about routing * right now.
-%% {"*", asterisk_h, []}
+ {"/send_message", send_message_h, []},
+ {"*", asterisk_h, []}
]},
{"127.0.0.1", [{"/echo/:key", echo_h, []}]},
{"example.org", [{"/echo/:key", echo_h, []}]}
@@ -603,20 +602,12 @@ asterisk_form_reject_if_not_options(Config) ->
"\r\n"),
{error, closed} = raw_recv(Client, 0, 1000).
-asterisk_form_empty_path(Config) ->
- doc("The path is empty when using asterisk-form. (RFC7230 5.5)"),
- #{code := 200, body := <<>>} = do_raw(Config,
+asterisk_form_empty_path_query(Config) ->
+ doc("The path and query components are empty when using asterisk-form. (RFC7230 5.5)"),
+ #{code := 200, body := <<"http://localhost">>} = do_raw(Config,
"OPTIONS * HTTP/1.1\r\n"
"Host: localhost\r\n"
- "X-Echo: path\r\n"
- "\r\n").
-
-asterisk_form_empty_query(Config) ->
- doc("The query is empty when using asterisk-form. (RFC7230 5.5)"),
- #{code := 200, body := <<>>} = do_raw(Config,
- "OPTIONS * HTTP/1.1\r\n"
- "Host: localhost\r\n"
- "X-Echo: query\r\n"
+ "X-Echo: uri\r\n"
"\r\n").
%% Invalid request-target.