aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_http_hd.erl
diff options
context:
space:
mode:
authorAndrei Nesterov <[email protected]>2016-03-06 17:53:42 +0300
committerAndrei Nesterov <[email protected]>2016-06-07 21:36:15 +0300
commit0f1dd8f0f90097e24657dc04ff396651892a7c98 (patch)
tree6c42d2088ebf836ae77b2dd24efd9ad6d6fccc6a /src/cow_http_hd.erl
parent9e6741f6c70c8c1d71763ac0a6a8bede5382e4d8 (diff)
downloadcowlib-0f1dd8f0f90097e24657dc04ff396651892a7c98.tar.gz
cowlib-0f1dd8f0f90097e24657dc04ff396651892a7c98.tar.bz2
cowlib-0f1dd8f0f90097e24657dc04ff396651892a7c98.zip
Add internal cow_http_hd:join_token_list/1, cow_http_hd:join_token_list/2
Diffstat (limited to 'src/cow_http_hd.erl')
-rw-r--r--src/cow_http_hd.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl
index d20a3c7..6a7837b 100644
--- a/src/cow_http_hd.erl
+++ b/src/cow_http_hd.erl
@@ -3250,3 +3250,9 @@ token_ci(R, Acc, T) -> token_ci_list_sep(R, [T|Acc]).
token_ci_list_sep(<<>>, Acc) -> lists:reverse(Acc);
token_ci_list_sep(<< C, R/bits >>, Acc) when ?IS_WS(C) -> token_ci_list_sep(R, Acc);
token_ci_list_sep(<< $,, R/bits >>, Acc) -> token_ci_list(R, Acc).
+
+join_token_list([]) -> [];
+join_token_list([H|T]) -> join_token_list(T, [H]).
+
+join_token_list([], Acc) -> lists:reverse(Acc);
+join_token_list([H|T], Acc) -> join_token_list(T, [H,<<", ">>|Acc]).