Serve SVG assets in deployment contract
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-09-07 13:37:57 +08:00
parent 1510bc8644
commit a3588d41a3
4 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -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",

View File

@@ -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",

View File

@@ -32,6 +32,7 @@ function deterministicBytes(size, seed) {
const fixtures = new Map([
["/index.html", write("index.html", "<!doctype html><title>Web Blender</title>")],
["/favicon.svg", write("favicon.svg", "<svg xmlns=\"http://www.w3.org/2000/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));