diff --git a/.talismanrc b/.talismanrc index 23fe040..d274394 100644 --- a/.talismanrc +++ b/.talismanrc @@ -8,6 +8,6 @@ fileignoreconfig: - filename: lefthook.yml checksum: ceb00460bb36a9b13ccbbc927598aa8757913d04d518f5092a9aa6926261cdc3 - filename: public/mockServiceWorker.js - checksum: daa620c709c07eed0da19b78818e0eb25ccc63951147fcaf50d6816fd14e777d + checksum: a3099205a43a7863559fd4f0a10c87bccf637fa61fdb587fd2a4ca2810f962ef - filename: src/config/locale.ts checksum: bce8adac9f7e05e5ed3d339f9b9a9d8bd2234a4663ddb1eafd110127cbbe4d9b diff --git a/package.json b/package.json index 3855495..2bf51e7 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "build:storybook": "storybook build", "prettier:check": "prettier --check .", "prettier:fix": "prettier --write --ignore-unknown .", - "eslint:check": "eslint --max-warnings=0", + "eslint:check": "eslint --max-warnings=0 --no-warn-ignored", "eslint:fix": "npm run eslint:check -- --fix", "audit:licenses": "license-checker --production --excludePrivatePackages --excludePackages @digitalservicebund/ris-ui@$(cat package.json | jq -r '.version') --onlyAllow \"$(. ./parse-allowed-licenses.sh)\" --csv --out ./frontend-license-report.csv", "typecheck": "vue-tsc", diff --git a/public/mockServiceWorker.js b/public/mockServiceWorker.js index 6eb8052..fead0b3 100644 --- a/public/mockServiceWorker.js +++ b/public/mockServiceWorker.js @@ -8,8 +8,8 @@ * - Please do NOT serve this file on production. */ -const PACKAGE_VERSION = '2.6.0' -const INTEGRITY_CHECKSUM = '07a8241b182f8a246a7cd39894799a9e' +const PACKAGE_VERSION = '2.6.6' +const INTEGRITY_CHECKSUM = 'ca7800994cc8bfb5eb961e037c877074' const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') const activeClientIds = new Set() @@ -192,12 +192,14 @@ async function getResponse(event, client, requestId) { const requestClone = request.clone() function passthrough() { - const headers = Object.fromEntries(requestClone.headers.entries()) - - // Remove internal MSW request header so the passthrough request - // complies with any potential CORS preflight checks on the server. - // Some servers forbid unknown request headers. - delete headers['x-msw-intention'] + // Cast the request headers to a new Headers instance + // so the headers can be manipulated with. + const headers = new Headers(requestClone.headers) + + // Remove the "accept" header value that marked this request as passthrough. + // This prevents request alteration and also keeps it compliant with the + // user-defined CORS policies. + headers.delete('accept', 'msw/passthrough') return fetch(requestClone, { headers }) }