From 575966be9f1f7ff19c06317cae233ff05f82b53d Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Wed, 7 Oct 2020 12:48:29 -0600 Subject: [PATCH] remove in place update safari has limited Blob api --- frontend/src/api/files.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/api/files.js b/frontend/src/api/files.js index b3fcb0aa..08f0d84a 100644 --- a/frontend/src/api/files.js +++ b/frontend/src/api/files.js @@ -85,8 +85,9 @@ export function download (format, ...files) { export async function post (url, content = '', overwrite = false, onupload) { url = removePrefix(url) + let bufferContent if (content instanceof Blob && !['http:', 'https:'].includes(window.location.protocol)) { - content = await content.arrayBuffer() + bufferContent = await new Response(content).arrayBuffer() } return new Promise((resolve, reject) => { @@ -112,7 +113,7 @@ export async function post (url, content = '', overwrite = false, onupload) { reject(error) } - request.send(content) + request.send(bufferContent || content) }) }