From 5c315ab1425965dfb2c10b274185a3fdf2645d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 30 Nov 2012 16:44:57 +0100 Subject: Return a 400 error if the Accept header was incorrect --- test/http_SUITE.erl | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/http_SUITE.erl') diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl index 238b28e..797be0d 100644 --- a/test/http_SUITE.erl +++ b/test/http_SUITE.erl @@ -48,6 +48,7 @@ -export([onresponse_crash/1]). -export([onresponse_reply/1]). -export([pipeline/1]). +-export([rest_bad_accept/1]). -export([rest_keepalive/1]). -export([rest_keepalive_post/1]). -export([rest_missing_get_callbacks/1]). @@ -95,6 +96,7 @@ groups() -> nc_rand, nc_zero, pipeline, + rest_bad_accept, rest_keepalive, rest_keepalive_post, rest_missing_get_callbacks, @@ -251,6 +253,7 @@ init_dispatch(Config) -> {file, <<"test_file.css">>}]}, {[<<"multipart">>], http_handler_multipart, []}, {[<<"echo">>, <<"body">>], http_handler_echo_body, []}, + {[<<"bad_accept">>], rest_simple_resource, []}, {[<<"simple">>], rest_simple_resource, []}, {[<<"forbidden_post">>], rest_forbidden_resource, [true]}, {[<<"simple_post">>], rest_forbidden_resource, [false]}, @@ -653,6 +656,14 @@ pipeline(Config) -> {ok, 200, _, Client11} = cowboy_client:response(Client10), {error, closed} = cowboy_client:response(Client11). +rest_bad_accept(Config) -> + Client = ?config(client, Config), + {ok, Client2} = cowboy_client:request(<<"GET">>, + build_url("/bad_accept", Config), + [{<<"accept">>, <<"1">>}], + Client), + {ok, 400, _, _} = cowboy_client:response(Client2). + rest_keepalive(Config) -> Client = ?config(client, Config), URL = build_url("/simple", Config), -- cgit v1.2.3