From 3d99bdd4549f361097de44eda542121f1b1a6fa7 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Fri, 29 Sep 2023 13:00:33 +0100 Subject: [PATCH] Fix image transcoding check. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 0bd4c7f..7f33608 100644 --- a/src/main.rs +++ b/src/main.rs @@ -219,7 +219,7 @@ async fn index(req: HttpRequest) -> Result> { if rewrite { if let Some(content_type) = resp.headers().get("content-type") { #[cfg(feature = "avif")] - if disallow_image_transcoding + if !disallow_image_transcoding && (content_type == "image/webp" || content_type == "image/jpeg" && avif) { let resp_bytes = resp.bytes().await.unwrap();