mirror of
https://github.com/tnb-labs/panel.git
synced 2026-08-30 17:05:19 +08:00
feat: 移除自定义压缩
This commit is contained in:
@@ -22,7 +22,6 @@ require (
|
||||
github.com/gookit/color v1.6.0
|
||||
github.com/gookit/validate v1.5.7-0.20260207022141-dc32dc1276cd
|
||||
github.com/hashicorp/go-version v1.8.0
|
||||
github.com/klauspost/compress v1.18.4
|
||||
github.com/leonelquinteros/gotext v1.7.2
|
||||
github.com/lib/pq v1.11.2
|
||||
github.com/libdns/alidns v1.0.6-beta.3.0.20260121104221-597b1e580e21
|
||||
@@ -84,6 +83,7 @@ require (
|
||||
github.com/jaevor/go-nanoid v1.4.0 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/klauspost/compress v1.18.4 // indirect
|
||||
github.com/kr/fs v0.1.0 // indirect
|
||||
github.com/libtnb/securecookie v1.2.0 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 // indirect
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
@@ -11,8 +10,6 @@ import (
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
"github.com/go-chi/httplog/v3"
|
||||
"github.com/google/wire"
|
||||
"github.com/klauspost/compress/gzip"
|
||||
"github.com/klauspost/compress/zstd"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
"github.com/libtnb/sessions"
|
||||
sessionmiddleware "github.com/libtnb/sessions/middleware"
|
||||
@@ -55,14 +52,6 @@ func NewMiddlewares(conf *config.Config, session *sessions.Manager, appRepo biz.
|
||||
// Globals is a collection of global middleware that will be applied to every request.
|
||||
func (r *Middlewares) Globals(t *gotext.Locale, mux *chi.Mux) []func(http.Handler) http.Handler {
|
||||
compressor := middleware.NewCompressor(6)
|
||||
compressor.SetEncoder("gzip", func(w io.Writer, level int) io.Writer {
|
||||
writer, _ := gzip.NewWriterLevel(w, level)
|
||||
return writer
|
||||
})
|
||||
compressor.SetEncoder("zstd", func(w io.Writer, level int) io.Writer {
|
||||
writer, _ := zstd.NewWriter(w, zstd.WithEncoderLevel(zstd.SpeedBetterCompression))
|
||||
return writer
|
||||
})
|
||||
|
||||
return []func(http.Handler) http.Handler{
|
||||
middleware.Recoverer,
|
||||
|
||||
Reference in New Issue
Block a user