mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Remove the meta functions from cowboy_req
Now that we have a public map they are pretty much pointless.
This commit is contained in:
parent
19468d0503
commit
bcff1262d0
1 changed files with 0 additions and 18 deletions
|
@ -40,9 +40,6 @@
|
|||
-export([parse_header/3]).
|
||||
-export([parse_cookies/1]).
|
||||
-export([match_cookies/2]).
|
||||
-export([meta/2]).
|
||||
-export([meta/3]).
|
||||
-export([set_meta/3]).
|
||||
|
||||
%% Request body API.
|
||||
-export([has_body/1]).
|
||||
|
@ -414,21 +411,6 @@ parse_cookies(Req) ->
|
|||
match_cookies(Fields, Req) ->
|
||||
filter(Fields, kvlist_to_map(Fields, parse_cookies(Req))).
|
||||
|
||||
-spec meta(atom(), req()) -> any() | undefined.
|
||||
meta(Name, Req) ->
|
||||
meta(Name, Req, undefined).
|
||||
|
||||
-spec meta(atom(), req(), any()) -> any().
|
||||
meta(Name, Req, Default) ->
|
||||
case lists:keyfind(Name, 1, Req#http_req.meta) of
|
||||
{Name, Value} -> Value;
|
||||
false -> Default
|
||||
end.
|
||||
|
||||
-spec set_meta(atom(), any(), Req) -> Req when Req::req().
|
||||
set_meta(Name, Value, Req=#http_req{meta=Meta}) ->
|
||||
Req#http_req{meta=lists:keystore(Name, 1, Meta, {Name, Value})}.
|
||||
|
||||
%% Request Body API.
|
||||
|
||||
-spec has_body(req()) -> boolean().
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue