UI和CouchDB之间的CORS问题 [英] CORS issue between UI and couchDB

查看:128
本文介绍了UI和CouchDB之间的CORS问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在UI和beddb之间存在CORS问题。
但是在ouchdb中启用了CORS,并且UI具有 res.header( Access-Control-Allow-Origin, *); 头。
但是我仍然有错误

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无法加载 http:// localhost:5984 / cp_display_template /
当凭据标记为true时,通配符'*'不能在'Access-Control-Allow-Origin'
标头中使用。来源‘ http:// localhost '是
,因此不允许访问。
XMLHttpRequest的凭据模式由withCredentials属性控制。

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.

有人知道为什么吗?

推荐答案

对此不是100%的确定,而是尝试使用 * 使用<$ c $ Access-Control-Allow-Origin标头中的c> localhost:5984 。因为出于安全原因,您可以允许所有请求。需要指定特定域

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

这篇关于UI和CouchDB之间的CORS问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆