File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,11 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch {
203
203
}
204
204
205
205
const hasBody =
206
- context . response . body &&
206
+ ( context . response . body ||
207
+ // https://github.com/unjs/ofetch/issues/324
208
+ // https://github.com/unjs/ofetch/issues/294
209
+ // https://github.com/JakeChampion/fetch/issues/1454
210
+ ( context . response as any ) . _bodyInit ) &&
207
211
! nullBodyResponses . has ( context . response . status ) &&
208
212
context . options . method !== "HEAD" ;
209
213
if ( hasBody ) {
@@ -222,7 +226,8 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch {
222
226
break ;
223
227
}
224
228
case "stream" : {
225
- context . response . _data = context . response . body ;
229
+ context . response . _data =
230
+ context . response . body || ( context . response as any ) . _bodyInit ; // (see refs above)
226
231
break ;
227
232
}
228
233
default : {
You can’t perform that action at this time.
0 commit comments