fixed html inline and slideshow frontend

This commit is contained in:
Elmar Kresse
2023-01-31 12:37:55 +01:00
parent c6657ede34
commit efbff89fa6
11 changed files with 772 additions and 207 deletions

12
main.go
View File

@ -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)
}