We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c1a52c commit b6a7262Copy full SHA for b6a7262
lib/fetch/body.js
@@ -348,7 +348,7 @@ const properties = {
348
bodyUsed: {
349
enumerable: true,
350
get () {
351
- return this[kState].body && util.isDisturbed(this[kState].body.stream)
+ return !!this[kState].body && util.isDisturbed(this[kState].body.stream)
352
}
353
354
test/node-fetch/response.js
@@ -224,4 +224,9 @@ describe('Response', () => {
224
const res = new Response(null, { statusText: undefined })
225
expect(res.statusText).to.equal('')
226
})
227
+
228
+ it('should not set bodyUsed to undefined', () => {
229
+ const res = new Response()
230
+ expect(res.bodyUsed).to.be.false
231
+ })
232
0 commit comments