From e8daab6b8412921b0855efa07ded72a8df256f2c Mon Sep 17 00:00:00 2001 From: Martin Kraft Date: Wed, 20 May 2020 19:05:21 -0400 Subject: [PATCH] MM-25369: Disable Brotli in 'dev' mode. (#14608) --- web/static.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web/static.go b/web/static.go index 2c9120cbda..79e61d504a 100644 --- a/web/static.go +++ b/web/static.go @@ -126,11 +126,13 @@ func staticFilesHandler(handler http.Handler) http.Handler { func brotliFilesHandler(handler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - isRequestingBrotliFile, contentType := requestingBrotliFileExtension(r) - if isRequestingBrotliFile && acceptsEncodingBrotli(r) { - r.URL.Path = r.URL.Path + ".br" - w.Header().Set("Content-Encoding", "br") - w.Header().Set("Content-Type", contentType) + if model.BuildNumber != "dev" { + isRequestingBrotliFile, contentType := requestingBrotliFileExtension(r) + if isRequestingBrotliFile && acceptsEncodingBrotli(r) { + r.URL.Path = r.URL.Path + ".br" + w.Header().Set("Content-Encoding", "br") + w.Header().Set("Content-Type", contentType) + } } handler.ServeHTTP(w, r)