0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00
cowboy/test/handlers/send_message_h.erl
Loïc Hoguin ce32e1985a
Add more tests to the rfc7230 suite
Found more bugs! Unfortunately no fix for them in this commit.
2017-11-24 00:16:19 +01:00

9 lines
288 B
Erlang

%% 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}.