diff options
author | Loïc Hoguin <[email protected]> | 2013-12-28 20:10:06 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-12-28 20:10:06 +0100 |
commit | 7a274661b297375c8c2c0c1d9cd23bb52185cf84 (patch) | |
tree | 32ca5d55abc9c60ca9af7bd2c729ccf94965e768 /src | |
parent | 6907541a788f4ae9da0bc3fe0ec3680583f5cf46 (diff) | |
download | cowboy-7a274661b297375c8c2c0c1d9cd23bb52185cf84.tar.gz cowboy-7a274661b297375c8c2c0c1d9cd23bb52185cf84.tar.bz2 cowboy-7a274661b297375c8c2c0c1d9cd23bb52185cf84.zip |
Fix typespecs for cowboy_req:binding/{2,3} and :bindings/1
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_req.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl index 5d12304..d98e395 100644 --- a/src/cowboy_req.erl +++ b/src/cowboy_req.erl @@ -334,14 +334,14 @@ url(HostURL, Req=#http_req{path=Path, qs=QS}) -> {<< HostURL/binary, Path/binary, QS2/binary >>, Req}. %% @equiv binding(Name, Req, undefined) --spec binding(atom(), Req) -> {binary() | undefined, Req} when Req::req(). +-spec binding(atom(), Req) -> {any() | undefined, Req} when Req::req(). binding(Name, Req) when is_atom(Name) -> binding(Name, Req, undefined). %% @doc Return the binding value for the given key obtained when matching %% the host and path against the dispatch list, or a default if missing. -spec binding(atom(), Req, Default) - -> {binary() | Default, Req} when Req::req(), Default::any(). + -> {any() | Default, Req} when Req::req(), Default::any(). binding(Name, Req, Default) when is_atom(Name) -> case lists:keyfind(Name, 1, Req#http_req.bindings) of {Name, Value} -> {Value, Req}; @@ -349,7 +349,7 @@ binding(Name, Req, Default) when is_atom(Name) -> end. %% @doc Return the full list of binding values. --spec bindings(Req) -> {list({atom(), binary()}), Req} when Req::req(). +-spec bindings(Req) -> {[{atom(), any()}], Req} when Req::req(). bindings(Req) -> {Req#http_req.bindings, Req}. |