From 9e6741f6c70c8c1d71763ac0a6a8bede5382e4d8 Mon Sep 17 00:00:00 2001 From: Andrei Nesterov Date: Sun, 6 Mar 2016 17:01:18 +0300 Subject: Add cow_http_hd:access_control_allow_credentials/0 --- src/cow_http_hd.erl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl index 4eac48a..d20a3c7 100644 --- a/src/cow_http_hd.erl +++ b/src/cow_http_hd.erl @@ -14,6 +14,7 @@ -module(cow_http_hd). +%% Parsing. -export([parse_accept/1]). -export([parse_accept_charset/1]). % @todo -export([parse_accept_datetime/1]). RFC7089 @@ -110,6 +111,9 @@ -export([parse_x_forwarded_for/1]). % @todo -export([parse_x_frame_options/1]). RFC7034 +%% Building. +-export([access_control_allow_credentials/0]). + -type etag() :: {weak | strong, binary()}. -export_type([etag/0]). @@ -203,6 +207,8 @@ qvalue_to_iodata(Q) when Q < 1000 -> [<<"0.">>, integer_to_binary(Q)]; qvalue_to_iodata(1000) -> <<"1">>. -endif. +%% Parsing. + %% @doc Parse the Accept header. -spec parse_accept(binary()) -> [{media_type(), qvalue(), [binary() | {binary(), binary()}]}]. @@ -3209,6 +3215,13 @@ parse_x_forwarded_for_error_test_() -> [{V, fun() -> {'EXIT', _} = (catch parse_x_forwarded_for(V)) end} || V <- Tests]. -endif. +%% Building. + +%% @doc Build the Access-Control-Allow-Credentials header. + +-spec access_control_allow_credentials() -> iodata(). +access_control_allow_credentials() -> <<"true">>. + %% Internal. %% Only return if the list is not empty. -- cgit v1.2.3