在 S3 中启用了 CORS,但遇到了 CORB 问题

时间:2021-07-19 20:00:57

标签: javascript amazon-s3 cross-origin-read-blocking

有两个 Url,一个是 abc.com,在一种情况下,假设重定向到 xyz.com/redirect-here,它位于 s3 存储桶中,并且工作正常。最近随着浏览器升级,注意到 CORS 问题。然后在 xyz.com/redirect-here 所在的 s3 存储桶中应用 CORS 策略。现在,CORS 问题已修复,但在控制台中发现 CORB 警告。在 abc.com > 控制台选项卡中显示 CORB 警告:跨域读取阻止 (CORB) 阻止了跨域响应 xyz.com/redirect-here with MIME type text/html。有关详细信息,请参阅 https://www.chromestatus.com/feature/5629709824032768。然后在网络选项卡中:有一个“redirect-here”请求条目,其状态代码为 200,请求 URL:xyz.com/redirect-here。以下是标题的完整详细信息。响应选项卡没有响应:“此请求没有可用的响应数据”。

预期的结果是让 abc.com 重定向到 xyz.com/redirect-here,但这里没有发生。请有任何想法。如果我尝试直接加载 xyz.com/redirect-here 页面,即使是响应标头也会显示 content-type: text/html。

HEADERS > GENERAL 
Request URL: xyz.com/redirect-here
Request Method: GET
Status Code: 200 
Remote Address: x.x.x.x:x
Referrer Policy: strict-origin-when-cross-origin

HEADERS > RESPONSE HEADERS
accept-ranges: bytes
access-control-allow-methods: HEAD, GET
access-control-allow-origin: *
access-control-max-age: 3000
cache-control: max-age=0
content-length: 1766
content-type: text/html
date: Fri, 16 Jul 2021 
etag: "xxxxxxxxxxxxxx"
last-modified: Thu, 08 Jul 2021 x
server: AmazonS3
via: 1.1 someid.cloudfront.net (CloudFront)
x-amz-cf-id: someid==
x-amz-cf-pop: some-id
x-cache: Error from cloudfront

HEADERS > REQUEST HEADERS
:authority: xyz.com
:method: GET
:path: /redirect-here
:scheme: https
accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cookie: _gid=cookie.1; _ga=cookie.2;
if-modified-since: Thu, 08 Jul 2021
if-none-match: "someid"
referer: abc.com/
sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"
sec-ch-ua-mobile: ?0
sec-fetch-dest: image
sec-fetch-mode: no-cors
sec-fetch-site: same-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36

0 个答案:

没有答案