Browse files

Checking for atom headers in util

  • Loading branch information...
1 parent 3c255e6 commit 736b84066b70b8ac2de238e79469d55f9d2bab06 @choptastic choptastic committed Apr 4, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/simple_bridge_util.erl
View
4 src/simple_bridge_util.erl
@@ -14,7 +14,7 @@
needs_expires_header/1
]).
--type header_key() :: string() | binary().
+-type header_key() :: string() | binary() | atom().
-type header() :: {header_key(), string()}.
-type header_list() :: [header()].
@@ -95,6 +95,8 @@ lower_keys(HeaderList) ->
[to_lower(Key) || {Key,_} <- HeaderList].
-spec to_lower(header_key()) -> string().
+to_lower(Header) when is_atom(Header) ->
+ to_lower(atom_to_list(Header));
to_lower(Header) when is_binary(Header) ->
to_lower(b2l(Header));
to_lower(Header) when is_list(Header) ->

0 comments on commit 736b840

Please sign in to comment.