diff options
author | Loïc Hoguin <[email protected]> | 2017-11-26 10:12:25 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-11-26 10:12:25 +0100 |
commit | e71733232eddaeb41d4d3a8fbcba49ca7975da79 (patch) | |
tree | 7ef425a21cf1d234e0c3228bf2878da815b1a762 /test/rfc7230_SUITE.erl | |
parent | 7cd59f43679aa349763f4d30624a0bd361633f41 (diff) | |
download | cowboy-e71733232eddaeb41d4d3a8fbcba49ca7975da79.tar.gz cowboy-e71733232eddaeb41d4d3a8fbcba49ca7975da79.tar.bz2 cowboy-e71733232eddaeb41d4d3a8fbcba49ca7975da79.zip |
Fix an rfc7230 test
Diffstat (limited to 'test/rfc7230_SUITE.erl')
-rw-r--r-- | test/rfc7230_SUITE.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/rfc7230_SUITE.erl b/test/rfc7230_SUITE.erl index 68e40e6..ea843a4 100644 --- a/test/rfc7230_SUITE.erl +++ b/test/rfc7230_SUITE.erl @@ -1867,13 +1867,14 @@ http10_request_no_transfer_encoding_in_response(Config) -> "Host: localhost\r\n" "\r\n"]), {_, 200, _, Rest} = cow_http:parse_status_line(raw_recv_head(Client)), - {RespHeaders, Rest2} = cow_http:parse_headers(Rest), + {RespHeaders, Body0} = cow_http:parse_headers(Rest), false = lists:keyfind(<<"content-length">>, 1, RespHeaders), false = lists:keyfind(<<"transfer-encoding">>, 1, RespHeaders), Body = <<0:8000000>>, - {ok, Body} = raw_recv(Client, byte_size(Body), 5000), + {ok, Body1} = raw_recv(Client, byte_size(Body) - byte_size(Body0), 5000), + Body = << Body0/binary, Body1/binary >>, %% The end of body is indicated by a connection close. - {error, timeout} = raw_recv(Client, 0, 1000), + {error, closed} = raw_recv(Client, 0, 1000), ok. no_te_no_trailers(Config) -> |