mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-24 16:05:00 +08:00
MM-25369: Disable Brotli in 'dev' mode. (#14608)
This commit is contained in:
+7
-5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user