Serve SVG assets in deployment contract
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user