Azure Blob 存储 请求的资源错误中不存在访问控制允许源标头

Azure Blob Storage No Access-Control-Allow-Origin header is present on the requested resource error

本文关键字:访问控制 不存在 许源标 错误 存储 Blob 请求 资源 Azure      更新时间:2023-09-26

我在Azure Blob Storage上上传时遇到问题。我能够生成 SAS 令牌,但是当我请求上传时,它会返回一个错误,指出:

XMLHttpRequest cannot load 
https://mycureresources.blob.core.windows.net/resources/test.jpeg?st=2016-0…BZj6%2FKcVWRvoLXkKfa109EV6%2FYuwmTs%3D&comp=block&blockid=YmxvY2stMDAwMDAw. 
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' 
header is present on the requested resource. Origin 'http://czar.opie.com:3210' is therefore not allowed access.
The response had HTTP status code 403.

简而言之,这是服务器端代码中的配置,您正在从浏览器请求。允许 CORS 请求"*"或您正在浏览的特定 IP。事实上,这是SOP(同源政策)的一个很好的功能。浏览器不允许来自访问控制允许来源标头中未提及的其他来源的请求。

相关文章: