You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/02/19 01:33:54 UTC

[GitHub] [couchdb] abstractalchemist opened a new issue #2570: Cross Origin configuration not working

abstractalchemist opened a new issue #2570: Cross Origin configuration not working
URL: https://github.com/apache/couchdb/issues/2570
 
 
   [NOTE]: # ( ^^ Provide a general summary of the issue in the title above. ^^ )
   
   ## 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
   
   [NOTE]: # ( Include commands to reproduce, if possible. curl is preferred. )
   
   ## Expected Behaviour
   
   After configuring CORs configuration, OPTIONS request respond correctly with appropriate headers.
   
   ## Your Environment
   
   
   * CouchDB version used: 2.3
   * Browser name and version: Chrome  80.0.3987.116
   * Operating system and version: Fedora 31
   
   ## Additional Context
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] wohali commented on issue #2570: Cross Origin configuration not working

Posted by GitBox <gi...@apache.org>.
wohali commented on issue #2570: Cross Origin configuration not working
URL: https://github.com/apache/couchdb/issues/2570#issuecomment-598969775
 
 
   Also see https://github.com/pouchdb/add-cors-to-couchdb

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] wohali commented on issue #2570: Cross Origin configuration not working

Posted by GitBox <gi...@apache.org>.
wohali commented on issue #2570: Cross Origin configuration not working
URL: https://github.com/apache/couchdb/issues/2570#issuecomment-598969352
 
 
   Looks like a reprise of https://issues.apache.org/jira/browse/COUCHDB-2027 .

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [couchdb] wohali commented on issue #2570: Cross Origin configuration not working

Posted by GitBox <gi...@apache.org>.
wohali commented on issue #2570: Cross Origin configuration not working
URL: https://github.com/apache/couchdb/issues/2570#issuecomment-598969657
 
 
   Is this a useful workaround for you?
   
   > My problem was solved by:
   > 
   > 1. adding headers= accept, authorization, content-type, origin into [cors] section of local.ini // the docs were not clear to me about this
   > 2. Adding an Authorization header in my AJAX request :
   
   ```javascript
   $.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")); } 
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services