aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/ranch.erl')
-rw-r--r--src/ranch.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ranch.erl b/src/ranch.erl
index fc9bad3..3fbb9a2 100644
--- a/src/ranch.erl
+++ b/src/ranch.erl
@@ -131,11 +131,17 @@ filter_options(UserOptions, AllowedKeys, DefaultOptions) ->
AllowedOptions = filter_user_options(UserOptions, AllowedKeys),
lists:foldl(fun merge_options/2, DefaultOptions, AllowedOptions).
+%% 2-tuple options.
filter_user_options([Opt = {Key, _}|Tail], AllowedKeys) ->
case lists:member(Key, AllowedKeys) of
true -> [Opt|filter_user_options(Tail, AllowedKeys)];
false -> filter_user_options(Tail, AllowedKeys)
end;
+%% Special option forms.
+filter_user_options([inet|Tail], AllowedKeys) ->
+ [inet|filter_user_options(Tail, AllowedKeys)];
+filter_user_options([inet6|Tail], AllowedKeys) ->
+ [inet6|filter_user_options(Tail, AllowedKeys)];
filter_user_options([Opt = {raw, _, _, _}|Tail], AllowedKeys) ->
case lists:member(raw, AllowedKeys) of
true -> [Opt|filter_user_options(Tail, AllowedKeys)];