CORS problems with Amazon S3 on the latest Chomium and Google Canary

前端 未结 4 1121
攒了一身酷
攒了一身酷 2020-12-05 05:16

Our website is having problems loading CSS and JS resources on a Amazon S3 bucket with the very latest version of Chromium (Version 33.0.1722.0 - 237596) and Chrome Canary.

4条回答
  •  独厮守ぢ
    2020-12-05 06:17

    Add any query parameter such as ?cacheblock=true to the url, like so:

    Instead of: https://somebucket.s3.amazonaws.com/someresource.pdf

    do: https://somebucket.s3.amazonaws.com/someresource.pdf?cacheblock=true

    The technical explanation I don't have entirely down. But it is something like the following:

    Including a query parameter will prevent the 'misbehaving' caching behavior in Chrome, causing Chrome to send out a fresh request for both the preflight request and the actual request, allowing the proper headers to be present on both requests, allowing S3 to respond properly. Approximately.

提交回复
热议问题