aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-12-31 00:11:59 +0100
committerLoïc Hoguin <[email protected]>2014-12-31 00:11:59 +0100
commit7871cc554bb970bc91bad1e2744a3ea5218c3c6c (patch)
treeb395fd929f27d1e3aac28d13cc8116e4a8b97d96
parent2548432042a97c4e174bb956e542b54203c46d3b (diff)
downloadcowlib-7871cc554bb970bc91bad1e2744a3ea5218c3c6c.tar.gz
cowlib-7871cc554bb970bc91bad1e2744a3ea5218c3c6c.tar.bz2
cowlib-7871cc554bb970bc91bad1e2744a3ea5218c3c6c.zip
Add cow_http_hd:parse_proxy_authorization/1
From RFC7235. See cow_http_hd:parse_authorization/1.
-rw-r--r--src/cow_http_hd.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl
index bfef48e..67eabc5 100644
--- a/src/cow_http_hd.erl
+++ b/src/cow_http_hd.erl
@@ -42,6 +42,7 @@
-export([parse_last_modified/1]).
-export([parse_max_forwards/1]).
-export([parse_pragma/1]).
+-export([parse_proxy_authorization/1]).
-export([parse_range/1]).
-export([parse_retry_after/1]).
-export([parse_sec_websocket_accept/1]).
@@ -2286,6 +2287,17 @@ parse_max_forwards_error_test_() ->
parse_pragma(<<"no-cache">>) -> no_cache;
parse_pragma(_) -> cache.
+%% @doc Parse the Proxy-Authorization header.
+%%
+%% Alias of parse_authorization/1 due to identical syntax.
+
+-spec parse_proxy_authorization(binary())
+ -> {basic, binary(), binary()}
+ | {bearer, binary()}
+ | {digest, [{binary(), binary()}]}.
+parse_proxy_authorization(ProxyAuthorization) ->
+ parse_authorization(ProxyAuthorization).
+
%% @doc Parse the Range header.
-spec parse_range(binary())