Dart application and cross domain policy

送分小仙女□ 提交于 2019-12-06 06:03:47
Andy

If you're after a stop gap solution, just for debugging, you can use a flag to turn it off in chrome.

[chromium executable] --disable-web-security

This is taken from this post Disable same origin policy in Chrome.

Otherwise, the addition header in the response is the right way to go. Of course, you can swap the asterisk for a list of IP addresses if you want to improve security.

See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS for more details.

Adding Access-Control-Allow-Origin: * to response headers on backend should be enough to make cross domain asynchronous requests.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!