aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-06-03 19:10:03 +0200
committerLoïc Hoguin <[email protected]>2013-06-03 19:10:03 +0200
commit1fc69977da8f57d5d3fa48cd68280aa2c0b1d78b (patch)
tree4498bedb4f940a83a8f9b04dfb539efcc1115f43 /test
parente50f7e40862e42feee227acbd3135657d2ea8ee2 (diff)
downloadcowboy-1fc69977da8f57d5d3fa48cd68280aa2c0b1d78b.tar.gz
cowboy-1fc69977da8f57d5d3fa48cd68280aa2c0b1d78b.tar.bz2
cowboy-1fc69977da8f57d5d3fa48cd68280aa2c0b1d78b.zip
Add sendfile support to SPDY, enabling cowboy_static use
Diffstat (limited to 'test')
-rw-r--r--test/spdy_SUITE.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/spdy_SUITE.erl b/test/spdy_SUITE.erl
index df29281..1089991 100644
--- a/test/spdy_SUITE.erl
+++ b/test/spdy_SUITE.erl
@@ -44,9 +44,13 @@ init_per_suite(Config) ->
application:start(cowboy),
application:start(public_key),
application:start(ssl),
- Config.
+ Dir = ?config(priv_dir, Config) ++ "/static",
+ ct_helper:create_static_dir(Dir),
+ [{static_dir, Dir}|Config].
-end_per_suite(_Config) ->
+end_per_suite(Config) ->
+ Dir = ?config(static_dir, Config),
+ ct_helper:delete_static_dir(Dir),
application:stop(ssl),
application:stop(public_key),
application:stop(cowboy),
@@ -69,9 +73,12 @@ end_per_group(Name, _) ->
%% Dispatch configuration.
-init_dispatch(_) ->
+init_dispatch(Config) ->
cowboy_router:compile([
{"localhost", [
+ {"/static/[...]", cowboy_static,
+ [{directory, ?config(static_dir, Config)},
+ {mimetypes, [{<<".css">>, [<<"text/css">>]}]}]},
{"/chunked", http_chunked, []},
{"/", http_handler, []}
]}
@@ -152,6 +159,7 @@ check_status(Config) ->
Tests = [
{200, nofin, "localhost", "/"},
{200, nofin, "localhost", "/chunked"},
+ {200, nofin, "localhost", "/static/style.css"},
{400, fin, "bad-host", "/"},
{400, fin, "localhost", "bad-path"},
{404, fin, "localhost", "/this/path/does/not/exist"}