CORS issue between UI and couchDB

2019-09-14 19:32发布

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条回答
戒情不戒烟
2楼-- · 2019-09-14 20:33

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

查看更多
登录 后发表回答