HTML5 Canvas getImageData and Same Origin Policy

后端 未结 9 1342
夕颜
夕颜 2020-11-29 07:49

I have a site running at pixie.strd6.com and images hosted through Amazon S3 with a CNAME for images.pixie.strd6.com.

I would like to be able to draw these images to

9条回答
  •  离开以前
    2020-11-29 08:19

    In the past Amazon S3 didn't allow you to modify or add the access-control-allow-origin and access-control-allow-credentials HTTP headers so it may have been better to switch to a different service like Rackspace Cloud Files or some other service that does.

    Add or modify the HTTP headers like this:

    access-control-allow-origin: [your site]
    access-control-allow-credentials: true
    

    See http://www.w3.org/TR/cors/#use-cases for more information.

    Using a service that allows you to modify the HTTP headers entirely solves the same origin problem.

提交回复
热议问题