[MM-45309] Replace github.com/mattermost/gziphandler with github.com/klauspost/compress/gzhttp (#24293)

Этот коммит содержится в:
Ben Schumacher
2023-10-12 08:27:31 +02:00
коммит произвёл GitHub
родитель eb35e83152
Коммит e4fa6200c3
6 изменённых файлов: 19 добавлений и 24 удалений

Просмотреть файл

@@ -13,7 +13,7 @@ import (
"path/filepath"
"strings"
"github.com/mattermost/gziphandler"
"github.com/klauspost/compress/gzhttp"
"github.com/mattermost/mattermost/server/public/model"
"github.com/mattermost/mattermost/server/public/shared/mlog"
@@ -39,8 +39,8 @@ func (w *Web) InitStatic() {
pluginHandler := staticFilesHandler(http.StripPrefix(path.Join(subpath, "static", "plugins"), http.FileServer(http.Dir(*w.srv.Config().PluginSettings.ClientDirectory))))
if *w.srv.Config().ServiceSettings.WebserverMode == "gzip" {
staticHandler = gziphandler.GzipHandler(staticHandler)
pluginHandler = gziphandler.GzipHandler(pluginHandler)
staticHandler = gzhttp.GzipHandler(staticHandler)
pluginHandler = gzhttp.GzipHandler(pluginHandler)
}
w.MainRouter.PathPrefix("/static/plugins/").Handler(pluginHandler)