mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Support fetching text
This commit is contained in:
parent
f7b302d34f
commit
d731eab51c
@ -115,6 +115,9 @@ export function createFetchRequest(createTimeout, serviceWorkerHandler) {
|
|||||||
} else if (format === "buffer") {
|
} else if (format === "buffer") {
|
||||||
body = await response.arrayBuffer();
|
body = await response.arrayBuffer();
|
||||||
}
|
}
|
||||||
|
else if (format === "text") {
|
||||||
|
body = await response.text();
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// some error pages return html instead of json, ignore error
|
// some error pages return html instead of json, ignore error
|
||||||
if (!(err.name === "SyntaxError" && status >= 400)) {
|
if (!(err.name === "SyntaxError" && status >= 400)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user