Skip to content

Commit 53befa6

Browse files
committed
make text the default if a wrong responseHandler is specified
1 parent c226444 commit 53befa6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/toolkit/src/query/fetchBaseQuery.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,12 @@ const handleResponse = async (
5454
responseHandler = isJsonContentType(response.headers) ? 'json' : 'text'
5555
}
5656

57-
if (responseHandler === 'text') {
58-
return response.text()
59-
}
60-
6157
if (responseHandler === 'json') {
6258
const text = await response.text()
6359
return text.length ? JSON.parse(text) : null
6460
}
6561

66-
return responseHandler
62+
return response.text()
6763
}
6864

6965
export type FetchBaseQueryError =

0 commit comments

Comments
 (0)