Support fetching text

This commit is contained in:
RMidhunSuresh 2022-07-15 15:04:54 +05:30
parent f7b302d34f
commit d731eab51c
1 changed files with 3 additions and 0 deletions

View File

@ -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)) {