我正在尝试通过 XMLHttpRequest 从 Firebase 存储下载文件,但未在资源上设置 Access-Control-Allow-Origin,因此这是不可能的。有没有办法在存储服务器上设置这个标头?
(let [xhr (js/XMLHttpRequest.)]
(.open xhr "GET" url)
(aset xhr "responseType" "arraybuffer")
(aset xhr "onload" #(js/console.log "bin" (.-response xhr)))
(.send xhr)))
铬错误信息:
XMLHttpRequest 无法加载 https://firebasestorage.googleapis.com/[EDITED] 请求的资源上不存在“Access-Control-Allow-Origin”标头。因此不允许访问源“ http://localhost:3449 ”。