From de49f1c6473fcd988766192e40d66d660cbb03c5 Mon Sep 17 00:00:00 2001 From: video-prize-ranch Date: Sat, 4 Jun 2022 20:48:28 -0400 Subject: [PATCH] Fix bug --- pages/media.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/media.go b/pages/media.go index f02ba09..f08ade5 100644 --- a/pages/media.go +++ b/pages/media.go @@ -29,7 +29,7 @@ func handleMedia(c *fiber.Ctx, url string) error { utils.SetHeaders(c) c.Set("Content-Security-Policy", "default-src 'none'; media-src 'self'; style-src 'self'; img-src 'self'; font-src 'self'; manifest-src 'self'; block-all-mixed-content") - if os.Getenv("FORCE_WEBP") == "1" && c.Query("no_webp") != "" && c.Accepts("image/webp") == "image/webp" { + if os.Getenv("FORCE_WEBP") == "1" && c.Query("no_webp") == "" && c.Accepts("image/webp") == "image/webp" { url = strings.ReplaceAll(url, ".png", ".webp") url = strings.ReplaceAll(url, ".jpg", ".webp") url = strings.ReplaceAll(url, ".jpeg", ".webp")