From e33baa044ae21552ccd68f8885d7012d94799c0b Mon Sep 17 00:00:00 2001 From: exAspArk Date: Fri, 17 Aug 2018 11:26:11 -0400 Subject: [PATCH] Allow customizing Cowboy protocol_options --- lib/trot/supervisor.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/trot/supervisor.ex b/lib/trot/supervisor.ex index 1a371de..e87aa0d 100644 --- a/lib/trot/supervisor.ex +++ b/lib/trot/supervisor.ex @@ -14,10 +14,11 @@ defmodule Trot.Supervisor do port when is_binary(port) -> String.to_integer(port) port -> port end + protocol_options = Application.get_env(:trot, :protocol_options, []) router_module = Application.get_env(:trot, :router, Trot.NotFound) children = [ - Plug.Adapters.Cowboy.child_spec(:http, router_module, [], [port: port]), + Plug.Adapters.Cowboy.child_spec(:http, router_module, [], [port: port, protocol_options: protocol_options]), ] supervise(children, strategy: :one_for_one) end