remove in place update

safari has limited Blob api
This commit is contained in:
Aiden McClelland 2020-10-07 12:48:29 -06:00
parent 1341e89076
commit 575966be9f

View File

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