mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00

In some cases we were sending a response faster than h2spec was sending us the test case data, resulting in the request being processed successfully instead of failing as expected.
9 lines
213 B
Erlang
9 lines
213 B
Erlang
%% This module sends a hello world response after a delay.
|
|
|
|
-module(delay_hello_h).
|
|
|
|
-export([init/2]).
|
|
|
|
init(Req, Delay) ->
|
|
timer:sleep(Delay),
|
|
{ok, cowboy_req:reply(200, #{}, <<"Hello world!">>, Req), Delay}.
|