diff options
author | Loïc Hoguin <[email protected]> | 2011-04-09 13:53:22 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2011-04-09 13:53:22 +0200 |
commit | c79df567bec9187f6ad27e4c6f4049dad730f0f2 (patch) | |
tree | 49bb8ead85f05172e706d2b0ee4ccd242b40aba7 /test/http_SUITE.erl | |
parent | 21dc1cc546eb9c7a095937205085383d3efe88ab (diff) | |
download | cowboy-c79df567bec9187f6ad27e4c6f4049dad730f0f2.tar.gz cowboy-c79df567bec9187f6ad27e4c6f4049dad730f0f2.tar.bz2 cowboy-c79df567bec9187f6ad27e4c6f4049dad730f0f2.zip |
ct: Add tests for incomplete requests leading to a timeout.
Diffstat (limited to 'test/http_SUITE.erl')
-rw-r--r-- | test/http_SUITE.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl index c8d44ad..1bcdcc6 100644 --- a/test/http_SUITE.erl +++ b/test/http_SUITE.erl @@ -90,7 +90,7 @@ raw_req(Packet, Config) -> [binary, {active, false}, {packet, raw}]), ok = gen_tcp:send(Socket, Packet), {ok, << "HTTP/1.1 ", Str:24/bits, _Rest/bits >>} - = gen_tcp:recv(Socket, 0, 5000), + = gen_tcp:recv(Socket, 0, 6000), gen_tcp:close(Socket), {Packet, list_to_integer(binary_to_list(Str))}. @@ -99,6 +99,14 @@ raw(Config) -> {"\r\n\r\n\r\n\r\n\r\nGET / HTTP/1.1\r\nHost: localhost\r\n\r\n", 200}, {"Garbage\r\n\r\n", 400}, {"GET / HTTP/1.1\r\nHost: dev-extend.eu\r\n\r\n", 400}, + {"", 408}, + {"\r\n", 408}, + {"\r\n\r\n", 408}, + {"GET / HTTP/1.1", 408}, + {"GET / HTTP/1.1\r\n", 408}, + {"GET / HTTP/1.1\r\nHost: localhost", 408}, + {"GET / HTTP/1.1\r\nHost: localhost\r\n", 408}, + {"GET / HTTP/1.1\r\nHost: localhost\r\n\r", 408}, {"GET http://localhost/ HTTP/1.1\r\n\r\n", 501}, {"GET / HTTP/1.2\r\nHost: localhost\r\n\r\n", 505} ], |