Skip to content

Commit 5556d88

Browse files
committed
update mockServiceWorker.js
1 parent 48da3e1 commit 5556d88

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

‎mockServiceWorker.js‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
/* tslint:disable */
33

44
/**
5-
* Mock Service Worker (2.0.3).
5+
* Mock Service Worker (2.0.10).
66
* @see https://github.com/mswjs/msw
77
* - Please do NOT modify this file.
88
* - Please do NOT serve this file on production.
99
*/
1010

11-
const INTEGRITY_CHECKSUM = '0877fcdc026242810f5bfde0d7178db4'
11+
const INTEGRITY_CHECKSUM = 'c5f7f8e188b673ea4e677df7ea3c5a39'
1212
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
1313
const activeClientIds = new Set()
1414

@@ -121,11 +121,6 @@ async function handleRequest(event, requestId) {
121121
if (client && activeClientIds.has(client.id)) {
122122
;(async function () {
123123
const responseClone = response.clone()
124-
// When performing original requests, response body will
125-
// always be a ReadableStream, even for 204 responses.
126-
// But when creating a new Response instance on the client,
127-
// the body for a 204 response must be null.
128-
const responseBody = response.status === 204 ? null : responseClone.body
129124

130125
sendToClient(
131126
client,
@@ -137,11 +132,11 @@ async function handleRequest(event, requestId) {
137132
type: responseClone.type,
138133
status: responseClone.status,
139134
statusText: responseClone.statusText,
140-
body: responseBody,
135+
body: responseClone.body,
141136
headers: Object.fromEntries(responseClone.headers.entries()),
142137
},
143138
},
144-
[responseBody],
139+
[responseClone.body],
145140
)
146141
})()
147142
}

0 commit comments

Comments
 (0)