Skip to content

Commit 8cbfd9d

Browse files
mymx2antfu
andauthoredDec 4, 2023
fix(useFetch): clone 'Response' on reading (#3607) (#3608)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
1 parent f2aeb45 commit 8cbfd9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎packages/core/useFetch/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ export function useFetch<T>(url: MaybeRefOrGetter<string>, ...args: any[]): UseF
469469
response.value = fetchResponse
470470
statusCode.value = fetchResponse.status
471471

472-
responseData = await fetchResponse[config.type]()
472+
responseData = await fetchResponse.clone()[config.type]()
473473

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

0 commit comments

Comments
 (0)
Please sign in to comment.