Don't force webp on /stack

This commit is contained in:
video-prize-ranch 2022-10-05 22:04:21 -04:00
parent 8576b5d517
commit c93d32a043
No known key found for this signature in database
GPG Key ID: D8EAA4C5B12A7281
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ func HandleUserAvatar(c *fiber.Ctx) error {
func handleMedia(c *fiber.Ctx, url string) error {
utils.SetHeaders(c)
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" && !strings.HasPrefix(c.Path(), "/stack") {
url = strings.ReplaceAll(url, ".png", ".webp")
url = strings.ReplaceAll(url, ".jpg", ".webp")
url = strings.ReplaceAll(url, ".jpeg", ".webp")