Browse Source

Add cow_http_hd:parse_http2_settings/1

No tests or benchmarks, we just call base64:decode on the value.
Loïc Hoguin 9 years ago
parent
commit
ff6b7e8f4e
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/cow_http_hd.erl

+ 7 - 1
src/cow_http_hd.erl

@@ -56,7 +56,7 @@
 % @todo -export([parse_forwarded/1]). RFC7239
 % @todo -export([parse_forwarded/1]). RFC7239
 % @todo -export([parse_from/1]). RFC7231
 % @todo -export([parse_from/1]). RFC7231
 -export([parse_host/1]).
 -export([parse_host/1]).
-% @todo -export([parse_http2_settings/1]). HTTP/2 (upcoming)
+-export([parse_http2_settings/1]).
 -export([parse_if_match/1]).
 -export([parse_if_match/1]).
 -export([parse_if_modified_since/1]).
 -export([parse_if_modified_since/1]).
 -export([parse_if_none_match/1]).
 -export([parse_if_none_match/1]).
@@ -1883,6 +1883,12 @@ horse_parse_host_ipv6_v4() ->
 	).
 	).
 -endif.
 -endif.
 
 
+%% @doc Parse the HTTP2-Settings header.
+
+-spec parse_http2_settings(binary()) -> binary().
+parse_http2_settings(HTTP2Settings) ->
+	base64:decode(HTTP2Settings).
+
 %% @doc Parse the If-Match header.
 %% @doc Parse the If-Match header.
 
 
 -spec parse_if_match(binary()) -> '*' | [etag()].
 -spec parse_if_match(binary()) -> '*' | [etag()].