CORS issue between UI and couchDB

我的未来我决定 提交于 2019-12-12 04:45:02

问题


I have CORS issue between UI and couchdb. But in couchdb CORS is enabled, and UI has res.header("Access-Control-Allow-Origin", "*"); header. But I still have an error

XMLHttpRequest cannot load http://localhost:5984/cp_display_template/. A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost' is therefore not allowed access. The credentials mode of an XMLHttpRequest is controlled by the withCredentials attribute.

Someone has an idea why?


回答1:


Not 100% sure about this but try instead using * use localhost:5984 in Access-Control-Allow-Origin header. because for some security reason you can allow all requests. need to indicate specific domain



来源:https://stackoverflow.com/questions/41961783/cors-issue-between-ui-and-couchdb

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