Skip to content

Commit

Permalink
fix(useFetch): clone 'Response' on reading (#3607) (#3608)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <[email protected]>
  • Loading branch information
mymx2 and antfu authored Dec 4, 2023
1 parent f2aeb45 commit 8cbfd9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/useFetch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ export function useFetch<T>(url: MaybeRefOrGetter<string>, ...args: any[]): UseF
response.value = fetchResponse
statusCode.value = fetchResponse.status

responseData = await fetchResponse[config.type]()
responseData = await fetchResponse.clone()[config.type]()

// see: https://www.tjvantoll.com/2015/09/13/fetch-and-errors/
if (!fetchResponse.ok) {
Expand Down

0 comments on commit 8cbfd9d

Please sign in to comment.