aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cowboy.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy.erl b/src/cowboy.erl
index f01bcf4..99615de 100644
--- a/src/cowboy.erl
+++ b/src/cowboy.erl
@@ -68,6 +68,6 @@ stop_listener(Ref) ->
-spec set_env(ranch:ref(), atom(), any()) -> ok.
set_env(Ref, Name, Value) ->
Opts = ranch:get_protocol_options(Ref),
- {_, Env} = maps:find(env, Opts),
+ Env = maps:get(env, Opts, #{}),
Opts2 = maps:put(env, maps:put(Name, Value, Env), Opts),
ok = ranch:set_protocol_options(Ref, Opts2).