diff options
Diffstat (limited to 'test/handlers/send_message_h.erl')
-rw-r--r-- | test/handlers/send_message_h.erl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/handlers/send_message_h.erl b/test/handlers/send_message_h.erl new file mode 100644 index 0000000..02d2139 --- /dev/null +++ b/test/handlers/send_message_h.erl @@ -0,0 +1,9 @@ +%% This module sends a message to the pid passed in a header. + +-module(send_message_h). +-export([init/2]). + +init(Req, State) -> + Pid = list_to_pid(binary_to_list(cowboy_req:header(<<"x-test-pid">>, Req))), + Pid ! {Pid, self(), init, Req, State}, + {ok, cowboy_req:reply(200, Req), State}. |