From 33ab1efb08cb997743425cb128b5148c8d9a151d Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 16 Nov 2017 20:49:28 +0000 Subject: [PATCH] Ensure that gzip is the final middleware to be initialised --- web/web.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/web.go b/web/web.go index 2eaac7f5..4aee3f84 100644 --- a/web/web.go +++ b/web/web.go @@ -42,7 +42,6 @@ func Setup(opts *cnf.Options) (err error) { s.Use(mw.Fail()) // Catch panics s.Use(mw.Logs()) // Log requests s.Use(mw.Sock()) // Log requests - s.Use(mw.Gzip()) // Gzip responses // Add trace information @@ -82,6 +81,10 @@ func Setup(opts *cnf.Options) (err error) { AllowedLength: 1 << 20, // 1mb })) + // Compress responses + + s.Use(mw.Gzip()) + // Log successful start log.WithPrefix("web").Infof("Started web server on %s", opts.Conn.Web)