Skip to content
This repository was archived by the owner on Jul 4, 2024. It is now read-only.

Commit 7af2a68

Browse files
authored
Merge pull request #9 from finalspy/patch-fetch
Avoid TypeError: stream is locked
2 parents 24b1de9 + 8656500 commit 7af2a68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mod.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ axiod.request = ({
187187
if (contentType.toLowerCase().indexOf("json") === -1) {
188188
// Try to convert to json
189189
try {
190-
_data = await x.json();
190+
_data = await x.clone().json();
191191
} catch (ex) {
192-
_data = await x.text();
192+
_data = await x.clone().text();
193193
}
194194
} else {
195-
_data = await x.json();
195+
_data = await x.clone().json();
196196
}
197197

198198
// transformResponse

0 commit comments

Comments
 (0)