Support AVIF in component server
Bug: chromium:1161661
Change-Id: I9d67209b299ebfb852d706543ae544b03108a6e2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2602987
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
diff --git a/scripts/component_server/server.js b/scripts/component_server/server.js
index 83b8b40..9238c22 100644
--- a/scripts/component_server/server.js
+++ b/scripts/component_server/server.js
@@ -252,7 +252,8 @@
}
let encoding = 'utf8';
- if (fullPath.endsWith('.wasm') || fullPath.endsWith('.png') || fullPath.endsWith('.jpg')) {
+ if (fullPath.endsWith('.wasm') || fullPath.endsWith('.png') || fullPath.endsWith('.jpg') ||
+ fullPath.endsWith('.avif')) {
encoding = 'binary';
}
@@ -274,6 +275,9 @@
} else if (fullPath.endsWith('.jpg')) {
response.setHeader('Content-Type', 'image/jpg');
encoding = 'binary';
+ } else if (fullPath.endsWith('.avif')) {
+ response.setHeader('Content-Type', 'image/avif');
+ encoding = 'binary';
}
response.writeHead(200);