From 8e835bce9fc28f5ddfd3a0818d5ec0e776182b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 6 Oct 2011 12:40:04 +0200 Subject: Close the connection when the application sends Connection: close Now Cowboy checks headers sent to the client for the 'Connection' header value, parses it, and checks whether it contains a 'close' or 'keep-alive' value. It makes sure to close or keep the connection alive depending on the value found there, if any. Also change chunked replies to not close the connection by default unless the application requests it. --- test/http_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl index 8bfebaa..cb70ff3 100644 --- a/test/http_SUITE.erl +++ b/test/http_SUITE.erl @@ -117,7 +117,7 @@ headers_dupe(Config) -> {ok, Data} = gen_tcp:recv(Socket, 0, 6000), {_Start, _Length} = binary:match(Data, <<"Connection: close">>), nomatch = binary:match(Data, <<"Connection: keep-alive">>), - ok = gen_tcp:close(Socket). + {error, closed} = gen_tcp:recv(Socket, 0, 1000). headers_huge(Config) -> Cookie = lists:flatten(["whatever_man_biiiiiiiiiiiig_cookie_me_want_77=" -- cgit v1.2.3