Cross-origin image load from cross-enabled site is denied

后端 未结 2 512
臣服心动
臣服心动 2021-01-24 17:51

I\'m trying to use CORS enabled image which is located on cors-enabled site: dropbox.com.
I\'ve got an error: cross-origin image load denied by CORS policy.

2条回答
  •  佛祖请我去吃肉
    2021-01-24 18:22

    I'm trying to use CORS enabled image which is located on cross-enabled site: dropbox.com.

    Dropbox isn't "cross-enabled".

    Correction: It appears that Dropbox's public folder is, but the URL you are using is not.

    I've got an error: cross-origin image load denied by CORS policy.

    And that's the evidence that it isn't

    How to fix it?

    Since you have no way of reconfiguring Dropbox's server to give you permission, you have to get the image from some other source. e.g. proxy them through your own server.

    If you were able to reconfigure the server, then you would enable CORS:

    Access-Control-Allow-Origin: https://your.site.example.com
    

提交回复
热议问题