From e51075cf687c8e79da6ef18bf7d749f9bc075deb Mon Sep 17 00:00:00 2001 From: Richard Petersen <richard.petersen@open-xchange.com> Date: Mon, 28 Feb 2022 11:45:39 +0100 Subject: [PATCH] Fix: In scaled environments, the version hash might differ from node to node Solution: Only use the hash of the version --- spec/headers_test.js | 2 +- src/files.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/headers_test.js b/spec/headers_test.js index 8e12d15..f2122fd 100644 --- a/spec/headers_test.js +++ b/spec/headers_test.js @@ -37,7 +37,7 @@ describe('Responses contain custom headers', function () { it('index.html has version', async function () { const response = await request(app).get('/index.html') expect(response.statusCode).to.equal(200) - expect(response.headers.version).to.match(/\d*\.\d*/) + expect(response.headers.version).to.equal('3038606729') }) it('javascript file contains dependencies', async function () { diff --git a/src/files.js b/src/files.js index d7b4af4..e13b56d 100644 --- a/src/files.js +++ b/src/files.js @@ -76,7 +76,7 @@ class FileCache { this._cache = cache this._manifests = manifests - this._hash = `${+new Date()}.${manifests.__hash__}` + this._hash = manifests.__hash__ this._dependencies = deps this._oxManifests = viteToOxManifest(manifests) -- GitLab