aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_http_hd.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-03-12 18:21:39 +0100
committerLoïc Hoguin <[email protected]>2016-03-12 18:21:39 +0100
commitff6b7e8f4e0ee31dcc817eedb890d0fe6d182b5c (patch)
treeb97f3ea355f8db58bdcd12d522a80d20b2ebae81 /src/cow_http_hd.erl
parent70b696808217f112d77ca30da9f2717427db7a3f (diff)
downloadcowlib-ff6b7e8f4e0ee31dcc817eedb890d0fe6d182b5c.tar.gz
cowlib-ff6b7e8f4e0ee31dcc817eedb890d0fe6d182b5c.tar.bz2
cowlib-ff6b7e8f4e0ee31dcc817eedb890d0fe6d182b5c.zip
Add cow_http_hd:parse_http2_settings/1
No tests or benchmarks, we just call base64:decode on the value.
Diffstat (limited to 'src/cow_http_hd.erl')
-rw-r--r--src/cow_http_hd.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl
index 1748208..64d28fb 100644
--- a/src/cow_http_hd.erl
+++ b/src/cow_http_hd.erl
@@ -56,7 +56,7 @@
% @todo -export([parse_forwarded/1]). RFC7239
% @todo -export([parse_from/1]). RFC7231
-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_modified_since/1]).
-export([parse_if_none_match/1]).
@@ -1883,6 +1883,12 @@ horse_parse_host_ipv6_v4() ->
).
-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.
-spec parse_if_match(binary()) -> '*' | [etag()].