Skip to content

Commit 7b8e6b8

Browse files
committed
try catch response type setter
1 parent 06b4175 commit 7b8e6b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/execute.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ export default function execute<T>(request: Request): Promise<Response<T>> {
137137
// Initializes the request
138138
xhr.open(request.method, request.url)
139139
// Copying the response type from the Request we received
140-
xhr.responseType = request.responseType
140+
141+
try {
142+
xhr.responseType = request.responseType
143+
} catch (err) {
144+
// setting not supported
145+
xhr.responseType = ''
146+
}
141147

142148
// Adapting the main XMLHttpRequest according to the passed Request
143149
if (request.responseType === 'json') {

0 commit comments

Comments
 (0)