EasyEngine / EasyEngine/easyengine

Avif images served with incorrect `Content-Type` header

Open
#1,888 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
2.2k
Forks
424
PR merge metrics
No merged PRs in 30d

Description

**Description**

I am using EasyEngine to host a WordPress website that utilizes the [Modern Image Formats](https://wordpress.org/plugins/webp-uploads/) plugin to convert images to WebP and Avif formats. While WebP images are served correctly, Avif images are being served with an incorrect `Content-Type` header (`application/octet-stream` instead of `image/avif`).

**Steps to Reproduce:**

1. Install EasyEngine on a server.
2. Create a WordPress site using EasyEngine.
3. Install the [Modern Image Formats](https://wordpress.org/plugins/webp-uploads/) plugin.
4. Configure the plugin to convert images to WebP and Avif.
5. Upload an image and observe the `Content-Type` header for the generated Avif version.

**Expected Behavior:**

Nginx should serve Avif images with the `Content-Type: image/avif` header.

**Actual Behavior:**

Nginx is serving Avif images with the `Content-Type: application/octet-stream` header.

**Additional Information:**

* EasyEngine version: `EE 4.8.0`
* Site having issue: https://privacysandbox-stories.com/

**Suggested Solution:**

Update EasyEngine's Nginx configuration to include the following line within the server block:

```nginx
location ~* \.(avif)$ {
add_header Content-Type image/avif;
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.