开发者社区> 问答> 正文

OSS跨域资源共享(CORS)错误排除,什么原因呢?

浏览器报403错误,具体如下: OPTIONS http://bucket.oss-cn-beijing.aliyuncs.com/ XMLHttpRequest cannot load http://bucket.oss-cn-beijing.aliyuncs.com/. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '{yourwebsiet}' is therefore not allowed access. The response had HTTP status code 403. OSS报CORS请求不允许的错误,具体如下: AccessForbidden CORSResponse: This CORS request is not allowed. This is usually because the evaluation of Origin, request method / Access-Control-Request-Method or Access-Control-Requet-Headers are not whitelisted by the resource's CORS spec.

展开
收起
雪哥哥 2022-01-01 15:23:36 1130 0
1 条回答
写回答
取消 提交回答
  • 可能原因,跨域规则配置错误 解决方案 按照以下步骤正确配置跨域规则。

    登录OSS管理控制台,选择目标Bucket,然后选择权限管理 > 跨域设置。 在跨域规则配置页面,设置以下参数: 来源(AllowedOrigin):设置为*。 允许Methods:选中全部选项(GET、PUT、DELETE、POST、HEAD)。 允许Headers:设置为*。 暴露Headers:设置为指定值或者不填 登录OSS管理控制台:https://oss.console.aliyun.com/?spm=a2c4g.11186623.0.0.62eb713fxMdFvI

    2022-01-02 13:01:07
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
OSS运维进阶实战手册 立即下载
《OSS运维基础实战手册》 立即下载
OSS运维基础实战手册 立即下载