2022-01-18 00:07:07 +00:00
|
|
|
package pages
|
|
|
|
|
2022-01-28 01:41:10 +00:00
|
|
|
import (
|
2022-06-05 00:56:04 +00:00
|
|
|
"os"
|
|
|
|
|
2022-01-28 01:41:10 +00:00
|
|
|
"codeberg.org/video-prize-ranch/rimgo/utils"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
)
|
2022-01-18 00:07:07 +00:00
|
|
|
|
2022-02-23 00:06:39 +00:00
|
|
|
func HandleFrontpage(c *fiber.Ctx) error {
|
2022-01-28 01:41:10 +00:00
|
|
|
utils.SetHeaders(c)
|
2022-07-16 20:02:59 +00:00
|
|
|
c.Set("X-Frame-Options", "DENY")
|
2022-01-28 01:41:10 +00:00
|
|
|
c.Set("Cache-Control", "public,max-age=31557600")
|
2022-11-18 17:08:18 +00:00
|
|
|
c.Set("Content-Security-Policy", "default-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'; style-src 'self'; img-src 'self'; manifest-src 'self'; block-all-mixed-content")
|
2022-01-18 00:07:07 +00:00
|
|
|
|
2022-02-02 15:53:33 +00:00
|
|
|
return c.Render("frontpage", fiber.Map{
|
2022-03-22 20:56:27 +00:00
|
|
|
"proto": c.Protocol(),
|
2022-02-02 15:53:33 +00:00
|
|
|
"domain": c.Hostname(),
|
2022-06-05 00:56:04 +00:00
|
|
|
"force_webp": os.Getenv("FORCE_WEBP"),
|
2022-02-02 15:53:33 +00:00
|
|
|
})
|
2022-01-18 00:07:07 +00:00
|
|
|
}
|