From a1d277ff3b61a39d61f1ed135c97643ad054d8aa Mon Sep 17 00:00:00 2001 From: Liam Stanley Date: Mon, 21 Sep 2020 22:50:00 -0400 Subject: [PATCH] fix: behind-proxy used on incorrect router --- metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics.go b/metrics.go index 790c600..2b5142c 100644 --- a/metrics.go +++ b/metrics.go @@ -56,7 +56,7 @@ func initMetrics(ctx context.Context, wg *sync.WaitGroup, errors chan<- error, r // Custom http server specifically for metrics (makes it easier to firewall off). mux := chi.NewRouter() if conf.Proxy { - r.Use(middleware.RealIP) + mux.Use(middleware.RealIP) } mux.Use(middleware.DefaultCompress)