Support fetching text
This commit is contained in:
parent
f7b302d34f
commit
d731eab51c
1 changed files with 3 additions and 0 deletions
|
@ -115,6 +115,9 @@ export function createFetchRequest(createTimeout, serviceWorkerHandler) {
|
|||
} else if (format === "buffer") {
|
||||
body = await response.arrayBuffer();
|
||||
}
|
||||
else if (format === "text") {
|
||||
body = await response.text();
|
||||
}
|
||||
} catch (err) {
|
||||
// some error pages return html instead of json, ignore error
|
||||
if (!(err.name === "SyntaxError" && status >= 400)) {
|
||||
|
|
Reference in a new issue