Fix bug
This commit is contained in:
parent
b323b26b57
commit
de49f1c647
|
@ -29,7 +29,7 @@ func handleMedia(c *fiber.Ctx, url string) error {
|
||||||
utils.SetHeaders(c)
|
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")
|
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, ".png", ".webp")
|
||||||
url = strings.ReplaceAll(url, ".jpg", ".webp")
|
url = strings.ReplaceAll(url, ".jpg", ".webp")
|
||||||
url = strings.ReplaceAll(url, ".jpeg", ".webp")
|
url = strings.ReplaceAll(url, ".jpeg", ".webp")
|
||||||
|
|
Loading…
Reference in New Issue