diff --git a/go.mod b/go.mod index 9d85e1e..713304a 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ require ( git.jlel.se/jlelse/template-strings v0.0.0-20220211095702-c012e3b5045b github.com/PuerkitoBio/goquery v1.8.0 github.com/alecthomas/chroma v0.10.0 - github.com/andybalholm/brotli v1.0.4 github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de github.com/c2h5oh/datasize v0.0.0-20200825124411-48ed595a09d2 github.com/carlmjohnson/requests v0.22.1 diff --git a/go.sum b/go.sum index 30ffdb6..82c801b 100644 --- a/go.sum +++ b/go.sum @@ -54,8 +54,6 @@ github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbf github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 h1:Kk6a4nehpJ3UuJRqlA3JxYxBZEqCeOmATOvrbT4p9RA= github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74/go.mod h1:cEWa1LVoE5KvSD9ONXsZrj0z6KqySlCCNKHlLzbqAt4= -github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c= diff --git a/http.go b/http.go index 06ccd9e..024fe0c 100644 --- a/http.go +++ b/http.go @@ -5,14 +5,12 @@ import ( "database/sql" "errors" "fmt" - "io" "log" "net" "net/http" "strconv" "time" - "github.com/andybalholm/brotli" "github.com/dchest/captcha" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" @@ -42,10 +40,7 @@ func (a *goBlog) startServer() (err error) { if a.cfg.Server.Logging { h = h.Append(a.logMiddleware) } - compressor := middleware.NewCompressor(flate.DefaultCompression) - compressor.SetEncoder("br", func(w io.Writer, _ int) io.Writer { - return brotli.NewWriter(w) - }) + compressor := middleware.NewCompressor(flate.BestCompression) h = h.Append(middleware.Recoverer, compressor.Handler, middleware.Heartbeat("/ping")) if a.httpsConfigured(false) { h = h.Append(a.securityHeaders)