fixed html inline and slideshow frontend
This commit is contained in:
12
main.go
12
main.go
@ -6,6 +6,7 @@ import (
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -17,6 +18,17 @@ func main() {
|
||||
return nil
|
||||
})
|
||||
|
||||
app.OnFileDownloadRequest().Add(func(e *core.FileDownloadEvent) error {
|
||||
|
||||
if strings.HasSuffix(e.ServedPath, ".html") {
|
||||
e.HttpContext.Response().Header().Set("Content-Disposition", "inline")
|
||||
e.HttpContext.Response().Header().Set("Content-Security-Policy", "")
|
||||
}
|
||||
log.Println(e.ServedPath)
|
||||
log.Println(e.HttpContext)
|
||||
return nil
|
||||
})
|
||||
|
||||
if err := app.Start(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user