aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_req.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cowboy_req.erl')
-rw-r--r--src/cowboy_req.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index ca31105..ffc6e12 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -326,18 +326,18 @@ binding(Name, Req) ->
-spec binding(atom(), req(), Default) -> any() | Default when Default::any().
binding(Name, #{bindings := Bindings}, Default) when is_atom(Name) ->
- case lists:keyfind(Name, 1, Bindings) of
- {_, Value} -> Value;
- false -> Default
+ case Bindings of
+ #{Name := Value} -> Value;
+ _ -> Default
end;
binding(Name, _, Default) when is_atom(Name) ->
Default.
--spec bindings(req()) -> [{atom(), any()}].
+-spec bindings(req()) -> cowboy_router:bindings().
bindings(#{bindings := Bindings}) ->
Bindings;
bindings(_) ->
- [].
+ #{}.
-spec header(binary(), req()) -> binary() | undefined.
header(Name, Req) ->