mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 02:36:17 +01:00
remove echo dependency
This commit is contained in:
@@ -102,13 +102,13 @@ func (h *Hub) Run() {
|
||||
})
|
||||
default:
|
||||
csp, cspExists := os.LookupEnv("CSP")
|
||||
se.Router.Any("/", func(e *core.RequestEvent) error {
|
||||
se.Router.Any("/{path...}", func(e *core.RequestEvent) error {
|
||||
if cspExists {
|
||||
e.Response.Header().Del("X-Frame-Options")
|
||||
e.Response.Header().Set("Content-Security-Policy", csp)
|
||||
}
|
||||
indexFallback := !strings.HasPrefix(e.Request.URL.Path, "/static/")
|
||||
return apis.Static(site.Dist, indexFallback)(e)
|
||||
return apis.Static(site.DistDirFS, indexFallback)(e)
|
||||
})
|
||||
}
|
||||
return se.Next()
|
||||
|
||||
Reference in New Issue
Block a user