mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-01-31 03:36:44 +03:00
fix(deps): update dependency msw to ^2.6.7 (#1763)
* fix(deps): update dependency msw to ^2.6.7 * Update --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Nathan Bierema <nbierema@gmail.com>
This commit is contained in:
parent
14201108e7
commit
415257cd41
|
@ -20,7 +20,7 @@
|
||||||
"@redux-devtools/rtk-query-monitor": "workspace:^",
|
"@redux-devtools/rtk-query-monitor": "workspace:^",
|
||||||
"@reduxjs/toolkit": "^2.4.0",
|
"@reduxjs/toolkit": "^2.4.0",
|
||||||
"framer-motion": "^11.13.1",
|
"framer-motion": "^11.13.1",
|
||||||
"msw": "^2.4.7",
|
"msw": "^2.6.7",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-icons": "^5.4.0",
|
"react-icons": "^5.4.0",
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
* - Please do NOT serve this file on production.
|
* - Please do NOT serve this file on production.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const PACKAGE_VERSION = '2.4.7'
|
const PACKAGE_VERSION = '2.6.7'
|
||||||
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
|
const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'
|
||||||
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
||||||
const activeClientIds = new Set()
|
const activeClientIds = new Set()
|
||||||
|
|
||||||
|
@ -62,7 +62,12 @@ self.addEventListener('message', async function (event) {
|
||||||
|
|
||||||
sendToClient(client, {
|
sendToClient(client, {
|
||||||
type: 'MOCKING_ENABLED',
|
type: 'MOCKING_ENABLED',
|
||||||
payload: true,
|
payload: {
|
||||||
|
client: {
|
||||||
|
id: client.id,
|
||||||
|
frameType: client.frameType,
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -155,6 +160,10 @@ async function handleRequest(event, requestId) {
|
||||||
async function resolveMainClient(event) {
|
async function resolveMainClient(event) {
|
||||||
const client = await self.clients.get(event.clientId)
|
const client = await self.clients.get(event.clientId)
|
||||||
|
|
||||||
|
if (activeClientIds.has(event.clientId)) {
|
||||||
|
return client
|
||||||
|
}
|
||||||
|
|
||||||
if (client?.frameType === 'top-level') {
|
if (client?.frameType === 'top-level') {
|
||||||
return client
|
return client
|
||||||
}
|
}
|
||||||
|
@ -183,12 +192,26 @@ async function getResponse(event, client, requestId) {
|
||||||
const requestClone = request.clone()
|
const requestClone = request.clone()
|
||||||
|
|
||||||
function passthrough() {
|
function passthrough() {
|
||||||
const headers = Object.fromEntries(requestClone.headers.entries())
|
// Cast the request headers to a new Headers instance
|
||||||
|
// so the headers can be manipulated with.
|
||||||
|
const headers = new Headers(requestClone.headers)
|
||||||
|
|
||||||
// Remove internal MSW request header so the passthrough request
|
// Remove the "accept" header value that marked this request as passthrough.
|
||||||
// complies with any potential CORS preflight checks on the server.
|
// This prevents request alteration and also keeps it compliant with the
|
||||||
// Some servers forbid unknown request headers.
|
// user-defined CORS policies.
|
||||||
delete headers['x-msw-intention']
|
const acceptHeader = headers.get('accept')
|
||||||
|
if (acceptHeader) {
|
||||||
|
const values = acceptHeader.split(',').map((value) => value.trim())
|
||||||
|
const filteredValues = values.filter(
|
||||||
|
(value) => value !== 'msw/passthrough',
|
||||||
|
)
|
||||||
|
|
||||||
|
if (filteredValues.length > 0) {
|
||||||
|
headers.set('accept', filteredValues.join(', '))
|
||||||
|
} else {
|
||||||
|
headers.delete('accept')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return fetch(requestClone, { headers })
|
return fetch(requestClone, { headers })
|
||||||
}
|
}
|
||||||
|
|
|
@ -2109,7 +2109,7 @@ importers:
|
||||||
specifier: ^11.13.1
|
specifier: ^11.13.1
|
||||||
version: 11.13.1(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
version: 11.13.1(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||||
msw:
|
msw:
|
||||||
specifier: ^2.4.7
|
specifier: ^2.6.7
|
||||||
version: 2.6.7(@types/node@20.17.9)(typescript@5.5.4)
|
version: 2.6.7(@types/node@20.17.9)(typescript@5.5.4)
|
||||||
react:
|
react:
|
||||||
specifier: ^18.3.1
|
specifier: ^18.3.1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user