diff options
author | Loïc Hoguin <[email protected]> | 2016-08-10 17:15:02 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-08-10 17:15:02 +0200 |
commit | e30d120bd8c9a4a7b469937d5b5be6a8dfe148d4 (patch) | |
tree | 5eb48865b2ad61d3c05bdc0e3e1f639a6b966ffe /examples/echo_get | |
parent | aa6f2ab5a48d90e47648dfb53e0894dcaa6f6aac (diff) | |
download | cowboy-e30d120bd8c9a4a7b469937d5b5be6a8dfe148d4.tar.gz cowboy-e30d120bd8c9a4a7b469937d5b5be6a8dfe148d4.tar.bz2 cowboy-e30d120bd8c9a4a7b469937d5b5be6a8dfe148d4.zip |
Make reply functions return Req
Diffstat (limited to 'examples/echo_get')
-rw-r--r-- | examples/echo_get/src/toppage_handler.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/echo_get/src/toppage_handler.erl b/examples/echo_get/src/toppage_handler.erl index 4c7f595..f89abab 100644 --- a/examples/echo_get/src/toppage_handler.erl +++ b/examples/echo_get/src/toppage_handler.erl @@ -5,10 +5,10 @@ -export([init/2]). -init(Req, Opts) -> - Method = cowboy_req:method(Req), - #{echo := Echo} = cowboy_req:match_qs([echo], Req), - echo(Method, Echo, Req), +init(Req0, Opts) -> + Method = cowboy_req:method(Req0), + #{echo := Echo} = cowboy_req:match_qs([echo], Req0), + Req = echo(Method, Echo, Req0), {ok, Req, Opts}. echo(<<"GET">>, undefined, Req) -> |