-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross Origin configuration not working #2570
Comments
Looks like a reprise of https://issues.apache.org/jira/browse/COUCHDB-2027 . |
Is this a useful workaround for you?
$.ajax({
type: "GET",
contentType: "application/json",
dataType: "json",
url: myUrl
beforeSend: setHeader,
error: function (error)
{ console.log(error); }
,
success: function (remoteAppInfo)
{ ... }
});
function setHeader(xhr)
{ console.log("setHeader"); xhr.setRequestHeader('Authorization',"Basic " + btoa("estanteuser:Dnbatfydnkwadm6f")); } |
CORS Issue here too. Chrome Browser Version 113.0.5672.93 (Official Build) (64-bit) Is it possible to configure CouchDB to respond to an HTTP OPTIONS request with a status 200 / response.ok true? JavaScript Fetch API. CouchDB server fails "blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status." I have tried using 127.0.0.1, localhost, a domain name, with and without https. Configuration below.
JavaScript fetch options:
|
No. I'm simply trying to do basic authentication to CouchDB. After more testing, the CORS issue surfaces only when I add the 'credentials': 'include' header. ...? |
CORS does not allow * origins and credentials use at the same time |
I can't make a call to CouchDB with basic authentication whatsoever. I just tried adding the Seems like a simple working example of a client-side HTTP fetch could be included in the documentation. Maybe CouchDB is not supposed to respond directly to web browsers? 3 days on this and at some point I suppose I'll have to move on to another DB alltogether.
|
Description
I'm attempting to use CouchDB directly from a browser-based application. I have configured CORs as directed in the documentation, and via the Fauxton Administrative interface, verified it is enabled. However, when I run an XMLHttpRequest in Chrome, it fails with a denial saying that "Http did not return with status code 200".
When running an "OPTIONS" request with curl, it also fails with
{"error":"method_not_allowed","reason":"Only DELETE,GET,HEAD,POST allowed"}
Steps to Reproduce
Expected Behaviour
After configuring CORs configuration, OPTIONS request respond correctly with appropriate headers.
Your Environment
Additional Context
The text was updated successfully, but these errors were encountered: