一个项目使用了Html5的Canvas画布标签,canvas显示的图片来源于sub1.xx.com这个子域名,当前页面的域是sub2.xx.com,一旦通过JS来调用:canvas.toDataURL(),就会报跨域的问题:
Redirect at origin 'http://sub1.xx.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://sub2.xx.com' is therefore not allowed access.
请问又拍云是否有相关的解决方案,或者能否加上关于图片跨域请求的头部Access-Control-Allow-Origin开放控制呢?
又拍云是支持跨域调用的.
请求头中包含了 Origin: * 字段
响应头中就会附加上 Access-Control-Allow-Origin: * 字段