mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-22 07:30:25 +00:00
httpd: reuse the same compressor among bindings
This commit is contained in:
parent
267d9f1831
commit
d32b195a57
1 changed files with 2 additions and 1 deletions
|
@ -21,6 +21,8 @@ import (
|
||||||
"github.com/drakkan/sftpgo/version"
|
"github.com/drakkan/sftpgo/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var compressor = middleware.NewCompressor(5)
|
||||||
|
|
||||||
type httpdServer struct {
|
type httpdServer struct {
|
||||||
binding Binding
|
binding Binding
|
||||||
staticFilesPath string
|
staticFilesPath string
|
||||||
|
@ -398,7 +400,6 @@ func (s *httpdServer) initializeRouter() {
|
||||||
})
|
})
|
||||||
|
|
||||||
router.Group(func(router chi.Router) {
|
router.Group(func(router chi.Router) {
|
||||||
compressor := middleware.NewCompressor(5)
|
|
||||||
router.Use(compressor.Handler)
|
router.Use(compressor.Handler)
|
||||||
fileServer(router, webStaticFilesPath, http.Dir(s.staticFilesPath))
|
fileServer(router, webStaticFilesPath, http.Dir(s.staticFilesPath))
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue