mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Fix the stream_body_set_resp test
It was failing from time to time due to the response being sent as two separate packets.
This commit is contained in:
parent
fd211d3c03
commit
d2f13366a9
1 changed files with 4 additions and 7 deletions
|
@ -408,13 +408,10 @@ The document has moved
|
||||||
{Packet, 400} = raw_req(Packet, Config).
|
{Packet, 400} = raw_req(Packet, Config).
|
||||||
|
|
||||||
stream_body_set_resp(Config) ->
|
stream_body_set_resp(Config) ->
|
||||||
{port, Port} = lists:keyfind(port, 1, Config),
|
{Packet, 200} = raw_resp(
|
||||||
{ok, Socket} = gen_tcp:connect("localhost", Port,
|
"GET /stream_body/set_resp HTTP/1.1\r\n"
|
||||||
[binary, {active, false}, {packet, raw}]),
|
"Host: localhost\r\nConnection: close\r\n\r\n", Config),
|
||||||
ok = gen_tcp:send(Socket, "GET /stream_body/set_resp HTTP/1.1\r\n"
|
{_Start, _Length} = binary:match(Packet, <<"stream_body_set_resp">>).
|
||||||
"Host: localhost\r\nConnection: close\r\n\r\n"),
|
|
||||||
{ok, Data} = gen_tcp:recv(Socket, 0, 6000),
|
|
||||||
{_Start, _Length} = binary:match(Data, <<"stream_body_set_resp">>).
|
|
||||||
|
|
||||||
static_mimetypes_function(Config) ->
|
static_mimetypes_function(Config) ->
|
||||||
TestURL = build_url("/static_mimetypes_function/test.html", Config),
|
TestURL = build_url("/static_mimetypes_function/test.html", Config),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue