From a3588d41a34fd9b3e912b5e752db0152eb5d01d4 Mon Sep 17 00:00:00 2001 From: mes123456 Date: Mon, 7 Sep 2026 13:37:57 +0800 Subject: [PATCH] Serve SVG assets in deployment contract --- docs/web/DEPLOYMENT.md | 4 ++-- docs/web/deployment-contract.json | 1 + tools/web/check-deployment-contract.mjs | 1 + tools/web/check-deployment-http.mjs | 4 +++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/web/DEPLOYMENT.md b/docs/web/DEPLOYMENT.md index 0dc8afec6..20a5942d5 100644 --- a/docs/web/DEPLOYMENT.md +++ b/docs/web/DEPLOYMENT.md @@ -199,8 +199,8 @@ with `200` and a different ETag. Immutable `/assets/*` names must include the Vi never reused for different bytes. The server must use the MIME map in the JSON contract. In particular, WebAssembly is -`application/wasm`, JavaScript is `text/javascript; charset=utf-8`, and NanoVDB is -`application/x-nanovdb`. +`application/wasm`, JavaScript is `text/javascript; charset=utf-8`, SVG is `image/svg+xml`, and +NanoVDB is `application/x-nanovdb`. ## Range and validators diff --git a/docs/web/deployment-contract.json b/docs/web/deployment-contract.json index cf23efb7d..638d39cf4 100644 --- a/docs/web/deployment-contract.json +++ b/docs/web/deployment-contract.json @@ -50,6 +50,7 @@ ".css": "text/css; charset=utf-8", ".wasm": "application/wasm", ".json": "application/json; charset=utf-8", + ".svg": "image/svg+xml", ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", diff --git a/tools/web/check-deployment-contract.mjs b/tools/web/check-deployment-contract.mjs index 0d606d75e..34e379962 100644 --- a/tools/web/check-deployment-contract.mjs +++ b/tools/web/check-deployment-contract.mjs @@ -38,6 +38,7 @@ for (const [extension, mime] of Object.entries({ ".css": "text/css; charset=utf-8", ".wasm": "application/wasm", ".json": "application/json; charset=utf-8", + ".svg": "image/svg+xml", ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", diff --git a/tools/web/check-deployment-http.mjs b/tools/web/check-deployment-http.mjs index ee5239246..5e20c105b 100644 --- a/tools/web/check-deployment-http.mjs +++ b/tools/web/check-deployment-http.mjs @@ -32,6 +32,7 @@ function deterministicBytes(size, seed) { const fixtures = new Map([ ["/index.html", write("index.html", "Web Blender")], + ["/favicon.svg", write("favicon.svg", "")], ["/assets/app.js", write("assets/app.js", "export const app = true;\n")], ["/assets/app.css", write("assets/app.css", "body { color: black; }\n")], ["/vendor/blender/single/web_engine.js", write("vendor/blender/single/web_engine.js", "export default () => {};\n")], @@ -103,6 +104,7 @@ try { const mimeCases = [ ["/index.html", ".html"], + ["/favicon.svg", ".svg"], ["/assets/app.js", ".js"], ["/assets/app.css", ".css"], ["/vendor/blender/single/web_engine.wasm", ".wasm"], @@ -176,7 +178,7 @@ try { assert.notEqual(changed.headers.get("etag"), etagFirst); assert.deepEqual(await body(changed), replacement); - process.stdout.write("deployment-http-ok mime=9 head=4 ranges=5 invalidRanges=6 resumeSha256=verified\n"); + process.stdout.write("deployment-http-ok mime=10 head=4 ranges=5 invalidRanges=6 resumeSha256=verified\n"); } finally { if (server.listening) await new Promise((resolve) => server.close(resolve));