From c1dd5b5176813d048654c66550a434ef30f96908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 17 Sep 2012 00:39:29 +0200 Subject: Add the private set_bindings/4 function used by cowboy_protocol --- src/cowboy_protocol.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cowboy_protocol.erl') diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl index bcbdf57..9042117 100644 --- a/src/cowboy_protocol.erl +++ b/src/cowboy_protocol.erl @@ -242,9 +242,9 @@ onrequest(Req, State=#state{onrequest=OnRequest}) -> dispatch(Req, State=#state{dispatch=Dispatch, host_tokens=HostTokens, path_tokens=PathTokens}) -> case cowboy_dispatcher:match(HostTokens, PathTokens, Dispatch) of - {ok, Handler, Opts, Binds, HostInfo, PathInfo} -> - handler_init(Req#http_req{host_info=HostInfo, path_info=PathInfo, - bindings=Binds}, State#state{handler={Handler, Opts}, + {ok, Handler, Opts, Bindings, HostInfo, PathInfo} -> + Req2 = cowboy_req:set_bindings(HostInfo, PathInfo, Bindings, Req), + handler_init(Req2, State#state{handler={Handler, Opts}, host_tokens=undefined, path_tokens=undefined}); {error, notfound, host} -> error_terminate(400, State); -- cgit v1.2.3