aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_cookies.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-07-26 13:58:48 +0200
committerLoïc Hoguin <[email protected]>2011-07-26 13:58:48 +0200
commit528d0ebffd11c8c07259e0e764f3381a12d82418 (patch)
tree0dc12838d686fb245dc5603bf52f545a57b22a41 /src/cowboy_cookies.erl
parentb75859e07511fc07954542872dd18548f3f7d4fc (diff)
downloadcowboy-528d0ebffd11c8c07259e0e764f3381a12d82418.tar.gz
cowboy-528d0ebffd11c8c07259e0e764f3381a12d82418.tar.bz2
cowboy-528d0ebffd11c8c07259e0e764f3381a12d82418.zip
Small cosmetic changes and doc update to the cookie patch
Diffstat (limited to 'src/cowboy_cookies.erl')
-rw-r--r--src/cowboy_cookies.erl18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/cowboy_cookies.erl b/src/cowboy_cookies.erl
index 8a11b19..3a50ba6 100644
--- a/src/cowboy_cookies.erl
+++ b/src/cowboy_cookies.erl
@@ -17,8 +17,7 @@
-module(cowboy_cookies).
-%% API.
--export([parse_cookie/1, cookie/3, cookie/2]).
+-export([parse_cookie/1, cookie/3, cookie/2]). %% API.
%% Types.
-type kv() :: {Name::binary(), Value::binary()}.
@@ -33,10 +32,7 @@
-include_lib("eunit/include/eunit.hrl").
-
-%% ----------------------------------------------------------------------------
-%% API
-%% ----------------------------------------------------------------------------
+%% API.
%% @doc Parse the contents of a Cookie header field, ignoring cookie
%% attributes, and return a simple property list.
@@ -110,10 +106,7 @@ cookie(Key, Value, Options) when is_binary(Key) andalso is_binary(Value) andalso
CookieParts = <<Cookie/binary, ExpiresPart/binary, SecurePart/binary, DomainPart/binary, PathPart/binary, HttpOnlyPart/binary>>,
{<<"Set-Cookie">>, CookieParts}.
-
-%% ----------------------------------------------------------------------------
-%% Private
-%% ----------------------------------------------------------------------------
+%% Internal.
%% @doc Check if a character is a white space character.
-spec is_whitespace(char()) -> boolean().
@@ -231,7 +224,6 @@ read_quoted(<<$\\, Any, Rest/binary>>, Acc) ->
read_quoted(<<C, Rest/binary>>, Acc) ->
read_quoted(Rest, <<Acc/binary, C>>).
-
%% @doc Drop characters while a function returns true.
-spec binary_dropwhile(fun((char()) -> boolean()), binary()) -> binary().
binary_dropwhile(_F, <<"">>) ->
@@ -294,9 +286,7 @@ any_to_binary(V) when is_atom(V) ->
any_to_binary(V) when is_integer(V) ->
list_to_binary(integer_to_list(V)).
-%% ----------------------------------------------------------------------------
-%% Tests
-%% ----------------------------------------------------------------------------
+%% Tests.
-ifdef(TEST).