|
2 | 2 | /* tslint:disable */ |
3 | 3 |
|
4 | 4 | /** |
5 | | - * Mock Service Worker (2.2.3). |
| 5 | + * Mock Service Worker. |
6 | 6 | * @see https://github.com/mswjs/msw |
7 | 7 | * - Please do NOT modify this file. |
8 | 8 | * - Please do NOT serve this file on production. |
9 | 9 | */ |
10 | 10 |
|
11 | | -const INTEGRITY_CHECKSUM = '223d191a56023cd36aa88c802961b911' |
| 11 | +const PACKAGE_VERSION = '2.3.1' |
| 12 | +const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423' |
12 | 13 | const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') |
13 | 14 | const activeClientIds = new Set() |
14 | 15 |
|
@@ -48,7 +49,10 @@ self.addEventListener('message', async function (event) { |
48 | 49 | case 'INTEGRITY_CHECK_REQUEST': { |
49 | 50 | sendToClient(client, { |
50 | 51 | type: 'INTEGRITY_CHECK_RESPONSE', |
51 | | - payload: INTEGRITY_CHECKSUM, |
| 52 | + payload: { |
| 53 | + packageVersion: PACKAGE_VERSION, |
| 54 | + checksum: INTEGRITY_CHECKSUM, |
| 55 | + }, |
52 | 56 | }) |
53 | 57 | break |
54 | 58 | } |
@@ -202,13 +206,6 @@ async function getResponse(event, client, requestId) { |
202 | 206 | return passthrough() |
203 | 207 | } |
204 | 208 |
|
205 | | - // Bypass requests with the explicit bypass header. |
206 | | - // Such requests can be issued by "ctx.fetch()". |
207 | | - const mswIntention = request.headers.get('x-msw-intention') |
208 | | - if (['bypass', 'passthrough'].includes(mswIntention)) { |
209 | | - return passthrough() |
210 | | - } |
211 | | - |
212 | 209 | // Notify the client that a request has been intercepted. |
213 | 210 | const requestBuffer = await request.arrayBuffer() |
214 | 211 | const clientMessage = await sendToClient( |
@@ -240,7 +237,7 @@ async function getResponse(event, client, requestId) { |
240 | 237 | return respondWithMock(clientMessage.data) |
241 | 238 | } |
242 | 239 |
|
243 | | - case 'MOCK_NOT_FOUND': { |
| 240 | + case 'PASSTHROUGH': { |
244 | 241 | return passthrough() |
245 | 242 | } |
246 | 243 | } |
|
0 commit comments