From 294dcb36485eb8119d09b6b36cc30ae7d7a39545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 14 Oct 2022 12:11:21 -1000 Subject: [PATCH] Serve the Origin-Agent-Cluster: ?1 header through .htaccess instead of a iframe-worker.php file --- build.js | 5 ++--- dist-web/.htaccess | 6 +++++- dist-web/iframe-worker.php | 7 ------- liveServer.js | 8 +++++++- 4 files changed, 14 insertions(+), 12 deletions(-) delete mode 100644 dist-web/iframe-worker.php diff --git a/build.js b/build.js index 9c85d0b0..37b6fc54 100644 --- a/build.js +++ b/build.js @@ -36,12 +36,11 @@ if (argv.platform === "browser") { let wasmWorkerUrl; if (wasmWorkerBackend === 'iframe') { const wasmWorkerOrigin = process.env.WASM_WORKER_ORIGIN || 'http://127.0.0.1:8778'; - const wasmWorkerFilename = process.env.WASM_WORKER_FILENAME || 'iframe-worker.html'; - wasmWorkerUrl = `${wasmWorkerOrigin}/${wasmWorkerFilename}`; + wasmWorkerUrl = `${wasmWorkerOrigin}/iframe-worker.html`; } else { wasmWorkerUrl = `${serviceWorkerOrigin}/wasm-worker.js`; } - + options = { ...defaults, entryPoints: { diff --git a/dist-web/.htaccess b/dist-web/.htaccess index aa15d6f4..cbcb6e71 100644 --- a/dist-web/.htaccess +++ b/dist-web/.htaccess @@ -1,4 +1,8 @@ AddType application/wasm .wasm RewriteEngine on -RewriteRule ^scope:.*?/(.*)$ $1 +RewriteRule ^scope:.*?/(.*)$ $1 + + + Header set Origin-Agent-Cluster: ?1 + diff --git a/dist-web/iframe-worker.php b/dist-web/iframe-worker.php deleted file mode 100644 index 0c16c419..00000000 --- a/dist-web/iframe-worker.php +++ /dev/null @@ -1,7 +0,0 @@ - { + res.setHeader('Origin-Agent-Cluster', '?1'); + next(); + }, + ], });