aboutsummaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2011-07-26Add a PropEr test for cowboy_dispatcher:split_host/1Loïc Hoguin
Mostly thanks to Magnus Klaar as it took me a while to figure out how PropEr tests had to be written.
2011-07-19Separate message and packet handling for websocketsLoïc Hoguin
Improves the readability of websocket handler code by having two functions: websocket_handle/3 handles the packets received from the socket, removing the tuple construct that was otherwise needed, so only websocket_handle(Data, Req, State) is needed now; websocket_info/3 handles the messages that the websocket handler process received, as websocket_info(Info, Req, State). Both functions return values are handled identically by Cowboy so nothing changes on that end.
2011-06-27do not send ports 80 and 443 - browsers get madSteven Gravell
Browsers get mad that the returned location address is not the same as what they sent, since the :(80|443) is stripped. Add a simple eunit test due to existing ct websockets tests not covering this case.
2011-05-08Add chunked reply support.Loïc Hoguin
Send the status line and headers using cowboy_http_req:chunked_reply/3, and individual chunks with cowboy_http_req:chunk/2.
2011-05-05Add headers_huge test, demonstrating issue #3 is fixed.Loïc Hoguin
The previous commit switching to raw recv + erlang:decode_packet/3 works around the OTP bug regarding headers size in http recv.
2011-05-05Switch the HTTP protocol to use binary packets instead of lists.Loïc Hoguin
The server now does a single recv (or more, but only if needed) which is then sent to erlang:decode_packet/3 multiple times. Since most requests are smaller than the default MTU on many platforms, we benefit from this greatly. In the case of requests with a body, the server usually read at least part of the body on the first recv. This is bufferized properly and used when later retrieving the body. In the case of pipelined requests, we can end up reading many requests in a single recv, which are then handled properly using only the buffer containing the received data.
2011-05-04Add cowboy_http_req:port/1.Loïc Hoguin
Returns the port given in the Host header if present, otherwise the default port of 443 for HTTPS and 80 for HTTP is returned.
2011-04-17ct: Throw garbage at the server then check if it's still up.Loïc Hoguin
Basically: cat /dev/urandom | nc host port Only run this test if cat and nc are available.
2011-04-14Initial draft-hixie-thewebsocketprotocol-76 support.Loïc Hoguin
2011-04-14Fix a bug where dupe headers were sent in cowboy_http_req:reply/4.Loïc Hoguin
Now the server defines default headers that can be overwritten by the handler simply by passing them to the reply/4 function. Default headers include, for now, Connection and Content-Length headers. Note that it isn't enough to change the Connection header to close a keep-alive connection server-side.
2011-04-10ct: Add a test for requests pipelining.Loïc Hoguin
2011-04-09ct: Add a test for \n which throws an error 400.Loïc Hoguin
2011-04-09Limit the number of empty lines to allow before the request-line.Loïc Hoguin
Defaults to 5. Prevents someone from indefinitely sending empty lines.
2011-04-09ct: Add tests for incomplete requests leading to a timeout.Loïc Hoguin
2011-04-09ct: Add raw tests to check that errors are properly handled.Loïc Hoguin
2011-04-08Initial work on a ct test suite for the HTTP protocol.Loïc Hoguin
Handles two basic tests for both HTTP and HTTPS. Also renames 'make test' into 'make tests'.