Fix image transcoding check.

This commit is contained in:
Kavin 2023-09-29 13:00:33 +01:00
parent 30c0926f2e
commit 3d99bdd454
No known key found for this signature in database
GPG key ID: 6E4598CA5C92C41F

View file

@ -219,7 +219,7 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
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();