From 95006c3291fb4e359b09cd9b3986ba425484c9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 14 May 2011 15:20:12 +0200 Subject: Add the required Date header in the HTTP replies. The formatted date is generated and kept up to date regularly by a gen_server process storing it in the cowboy_clock ets table. Then it is retrieved by other processes simply by reading the table. --- src/cowboy_sup.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/cowboy_sup.erl') diff --git a/src/cowboy_sup.erl b/src/cowboy_sup.erl index e12b3aa..278df54 100644 --- a/src/cowboy_sup.erl +++ b/src/cowboy_sup.erl @@ -30,4 +30,6 @@ start_link() -> -spec init([]) -> term(). %% @todo These specs should be improved. init([]) -> - {ok, {{one_for_one, 10, 10}, []}}. + Procs = [{cowboy_clock, {cowboy_clock, start_link, []}, + permanent, 5000, worker, dynamic}], + {ok, {{one_for_one, 10, 10}, Procs}}. -- cgit v1.2.3