Browse Source

Add cow_http_hd:access_control_allow_credentials/0

Andrei Nesterov 9 years ago
parent
commit
9e6741f6c7
1 changed files with 13 additions and 0 deletions
  1. 13 0
      src/cow_http_hd.erl

+ 13 - 0
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.