From 075db4773bad8d17d0ddeb5b82955f71b2faaeb0 Mon Sep 17 00:00:00 2001 From: Bharat Patel <13206972+bharat-p@users.noreply.github.com> Date: Mon, 18 May 2020 10:00:14 -0700 Subject: [PATCH] Fixes #3995 Use handlers with middleware when starting Graceful server --- app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.go b/app.go index d9e85e9b..88403201 100644 --- a/app.go +++ b/app.go @@ -123,7 +123,7 @@ func (app *App) Run(mws ...MiddleWare) { httpsAddr = fmt.Sprintf("%s:%d", BConfig.Listen.HTTPSAddr, BConfig.Listen.HTTPSPort) app.Server.Addr = httpsAddr } - server := grace.NewServer(httpsAddr, app.Handlers) + server := grace.NewServer(httpsAddr, app.Server.Handler) server.Server.ReadTimeout = app.Server.ReadTimeout server.Server.WriteTimeout = app.Server.WriteTimeout if BConfig.Listen.EnableMutualHTTPS { @@ -152,7 +152,7 @@ func (app *App) Run(mws ...MiddleWare) { } if BConfig.Listen.EnableHTTP { go func() { - server := grace.NewServer(addr, app.Handlers) + server := grace.NewServer(addr, app.Server.Handler) server.Server.ReadTimeout = app.Server.ReadTimeout server.Server.WriteTimeout = app.Server.WriteTimeout if BConfig.Listen.ListenTCP4 {