From ae0dd616737d8e1116de4a04be0bc84188997eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 10 Aug 2016 11:49:31 +0200 Subject: Add tests for responses and request body reading This is a large commit. The cowboy_req interface has largely changed, and will change a little more. It's possible that some examples or tests have not been converted to the new interface yet. The documentation has not yet been updated. All of this will be fixed in smaller subsequent commits. Gotta start somewhere... --- src/cowboy.erl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/cowboy.erl') diff --git a/src/cowboy.erl b/src/cowboy.erl index 3387224..8ef9f8a 100644 --- a/src/cowboy.erl +++ b/src/cowboy.erl @@ -27,19 +27,15 @@ | {atom(), cowboy_constraints:constraint() | [cowboy_constraints:constraint()], any()}]. -export_type([fields/0]). --type http_headers() :: [{binary(), iodata()}]. +-type http_headers() :: #{binary() => iodata()}. -export_type([http_headers/0]). -type http_status() :: non_neg_integer() | binary(). -export_type([http_status/0]). --type http_version() :: 'HTTP/1.1' | 'HTTP/1.0'. +-type http_version() :: 'HTTP/2' | 'HTTP/1.1' | 'HTTP/1.0'. -export_type([http_version/0]). --type onresponse_fun() :: - fun((http_status(), http_headers(), iodata(), Req) -> Req). --export_type([onresponse_fun/0]). - -spec start_clear(ranch:ref(), non_neg_integer(), ranch_tcp:opts(), cowboy_protocol:opts()) -> {ok, pid()} | {error, any()}. start_clear(Ref, NbAcceptors, TransOpts0, ProtoOpts) -- cgit v1.2.3