diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cow_hpack.erl | 8 | ||||
-rw-r--r-- | src/cow_http.erl | 1 | ||||
-rw-r--r-- | src/cow_http_hd.erl | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/cow_hpack.erl b/src/cow_hpack.erl index 4ddd473..e11b98b 100644 --- a/src/cow_hpack.erl +++ b/src/cow_hpack.erl @@ -32,7 +32,7 @@ -record(state, { size = 0 :: non_neg_integer(), max_size = 4096 :: non_neg_integer(), - dyn_table = [] :: queue:queue({binary(), binary()}) + dyn_table = [] :: [{pos_integer(), {binary(), binary()}}] }). -opaque state() :: #state{}. @@ -548,15 +548,15 @@ resp_decode_test() -> %% Encoding. --spec encode(cow_http:headers()) -> iodata(). +-spec encode(cow_http:headers()) -> {iodata(), state()}. encode(Headers) -> encode(Headers, init(), #{}, []). --spec encode(cow_http:headers(), State) -> iodata() when State::state(). +-spec encode(cow_http:headers(), State) -> {iodata(), State} when State::state(). encode(Headers, State) -> encode(Headers, State, #{}, []). --spec encode(cow_http:headers(), State, opts()) -> iodata() when State::state(). +-spec encode(cow_http:headers(), State, opts()) -> {iodata(), State} when State::state(). encode(Headers, State, Opts) -> encode(Headers, State, Opts, []). diff --git a/src/cow_http.erl b/src/cow_http.erl index c76675c..07b4b36 100644 --- a/src/cow_http.erl +++ b/src/cow_http.erl @@ -28,6 +28,7 @@ -type version() :: 'HTTP/1.0' | 'HTTP/1.1'. -type status() :: 100..999. -type headers() :: [{binary(), iodata()}]. +-export_type([headers/0]). -include("cow_inline.hrl"). diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl index 4496949..600f21a 100644 --- a/src/cow_http_hd.erl +++ b/src/cow_http_hd.erl @@ -1970,7 +1970,7 @@ horse_parse_host_ipv6_v4() -> %% @doc Parse the HTTP2-Settings header. --spec parse_http2_settings(binary()) -> binary(). +-spec parse_http2_settings(binary()) -> map(). parse_http2_settings(HTTP2Settings) -> cow_http2:parse_settings_payload(base64:decode(HTTP2Settings)). |