Merge: + http server: enable gzip compression
Close #626 * commit '3f404bc37e14bbd781f6feb62502a44188b4c7ef': + http server: enable gzip compression for /control/querylog + http server: enable gzip compression for static documents
This commit is contained in:
4
app.go
4
app.go
@@ -15,6 +15,7 @@ import (
|
||||
"syscall"
|
||||
|
||||
"github.com/AdguardTeam/golibs/log"
|
||||
"github.com/NYTimes/gziphandler"
|
||||
"github.com/gobuffalo/packr"
|
||||
)
|
||||
|
||||
@@ -145,8 +146,9 @@ func run(args options) {
|
||||
|
||||
// Initialize and run the admin Web interface
|
||||
box := packr.NewBox("build/static")
|
||||
|
||||
// if not configured, redirect / to /install.html, otherwise redirect /install.html to /
|
||||
http.Handle("/", postInstallHandler(optionalAuthHandler(http.FileServer(box))))
|
||||
http.Handle("/", postInstallHandler(optionalAuthHandler(gziphandler.GzipHandler(http.FileServer(box)))))
|
||||
registerControlHandlers()
|
||||
|
||||
// add handlers for /install paths, we only need them when we're not configured yet
|
||||
|
||||
Reference in New Issue
Block a user