Skip to content

Commit

Permalink
fix(useFetch): ssr compactible for headersToObject
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jun 15, 2022
1 parent 151892b commit 8f541b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/useFetch/index.ts
Expand Up @@ -209,9 +209,8 @@ function isFetchOptions(obj: object): obj is UseFetchOptions {
}

function headersToObject(headers: HeadersInit | undefined) {
if (headers instanceof Headers)
if (typeof Headers !== 'undefined' && headers instanceof Headers)
return Object.fromEntries([...headers.entries()])

return headers
}

Expand Down

0 comments on commit 8f541b0

Please sign in to comment.