From d3887bf6cc180118be9fc8a031cc3aefbfbeb668 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sun, 25 Aug 2024 13:25:32 +0200 Subject: [bugfix] Let prometheus client do its own compression handling (#3232) --- cmd/gotosocial/action/server/server.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/gotosocial/action/server/server.go b/cmd/gotosocial/action/server/server.go index c2c5e25cd..2ea48b7df 100644 --- a/cmd/gotosocial/action/server/server.go +++ b/cmd/gotosocial/action/server/server.go @@ -439,13 +439,18 @@ var Start action.GTSAction = func(ctx context.Context) error { fsThrottle := middleware.Throttle(cpuMultiplier, retryAfter) // fileserver / web templates / emojis pkThrottle := middleware.Throttle(cpuMultiplier, retryAfter) // throttle public key endpoint separately - gzip := middleware.Gzip() // applied to all except fileserver + // Gzip middleware is applied to all endpoints except + // fileserver (compression too expensive for those), + // health (which really doesn't need compression), and + // metrics (which does its own compression handling that + // is rather annoying to neatly override). + gzip := middleware.Gzip() // these should be routed in order; // apply throttling *after* rate limiting authModule.Route(route, clLimit, clThrottle, gzip) clientModule.Route(route, clLimit, clThrottle, gzip) - metricsModule.Route(route, clLimit, clThrottle, gzip) + metricsModule.Route(route, clLimit, clThrottle) healthModule.Route(route, clLimit, clThrottle) fileserverModule.Route(route, fsMainLimit, fsThrottle) fileserverModule.RouteEmojis(route, instanceAccount.ID, fsEmojiLimit, fsThrottle) -- cgit v1.2.3