remove in place update
safari has limited Blob api
This commit is contained in:
parent
1341e89076
commit
575966be9f
@ -85,8 +85,9 @@ export function download (format, ...files) {
|
|||||||
export async function post (url, content = '', overwrite = false, onupload) {
|
export async function post (url, content = '', overwrite = false, onupload) {
|
||||||
url = removePrefix(url)
|
url = removePrefix(url)
|
||||||
|
|
||||||
|
let bufferContent
|
||||||
if (content instanceof Blob && !['http:', 'https:'].includes(window.location.protocol)) {
|
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) => {
|
return new Promise((resolve, reject) => {
|
||||||
@ -112,7 +113,7 @@ export async function post (url, content = '', overwrite = false, onupload) {
|
|||||||
reject(error)
|
reject(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
request.send(content)
|
request.send(bufferContent || content)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user