mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
feat: gzip static resources (#6258)
This commit is contained in:
parent
76916b0ad6
commit
eb517c2e12
3 changed files with 12 additions and 4 deletions
|
@ -3,6 +3,8 @@ package file
|
|||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/gorilla/handlers"
|
||||
)
|
||||
|
||||
// Handler represents an HTTP API handler for managing static files.
|
||||
|
@ -13,8 +15,11 @@ type Handler struct {
|
|||
// NewHandler creates a handler to serve static files.
|
||||
func NewHandler(assetPublicPath string) *Handler {
|
||||
h := &Handler{
|
||||
Handler: http.FileServer(http.Dir(assetPublicPath)),
|
||||
Handler: handlers.CompressHandler(
|
||||
http.FileServer(http.Dir(assetPublicPath)),
|
||||
),
|
||||
}
|
||||
|
||||
return h
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue