CORS.预设网址. S3 [英] CORS. Presigned URL. S3

查看:79
本文介绍了CORS.预设网址. S3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经生成了一个预签名的S3 POST URL.使用返回参数,然后将其传递到我的代码中,但我不断收到此错误Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource..

I've generated a presigned S3 POST URL. Using the return parameters, I then pass it into my code, but I keep getting this error Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource..

在Postman上,我可以提交带有一个附件的表单数据.

Whereas on Postman, I'm able to submit the form-data with one attached file.

在PostMan上,我手动输入了参数

On PostMan, I manually entered the parameters

然后将相同的参数输入到我的代码中.

The same parameters are then entered into my code.

推荐答案

您必须将 CORS配置编辑为公开,例如:

You must edit the CORS Configuration to be public , something like:

   <?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>POST</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>

这篇关于CORS.预设网址. S3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆