CORS policy on cached Image

前端 未结 3 1803
执笔经年
执笔经年 2021-01-31 02:05

In chrome 22 & safari 6.

Loading images from s3 for usage in a canvas (with extraction as a primary intent) using a CORS enabled S3 bucket, with the following code:<

3条回答
  •  离开以前
    2021-01-31 02:16

    The problem is that the image is cached from a former request, without the required CORS headers.Thus, when you ask for it again, for the canvas, with the 'crossorigin' specified, the browser uses the cached version, doesn't see the necessary headers, and raises a CORS error. When you add the '?_' to the url, the browser ignores the cache, as this is another URL. Take a look at this thread: https://bugs.chromium.org/p/chromium/issues/detail?id=409090

    Firefox and other browsers do no have that problem.

提交回复
热议问题