Skip to content

Commit

Permalink
Update fetch.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Oct 8, 2024
1 parent 8ae2973 commit df30e5d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch {

const hasBody =
(context.response.body ||
// https://github.com/JakeChampion/fetch/issues/1454
// https://github.com/unjs/ofetch/issues/324
// https://github.com/unjs/ofetch/issues/294
// https://github.com/JakeChampion/fetch/issues/1454
(context.response as any)._bodyInit) &&
!nullBodyResponses.has(context.response.status) &&
context.options.method !== "HEAD";
Expand All @@ -217,10 +218,8 @@ export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch {
}
case "stream": {
context.response._data =
context.response.body ||
// https://github.com/JakeChampion/fetch/issues/1454
// https://github.com/unjs/ofetch/issues/294
(context.response as any)._bodyInit;
context.response.body ||
(context.response as any)._bodyInit; // (see refs above)
break;
}
default: {
Expand Down

0 comments on commit df30e5d

Please sign in to comment.