incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giovanni P <fiat...@gmail.com>
Subject Re: HTTP access control (CORS, Cross Origin Resource Sharing ) problem with couchdb server
Date Fri, 23 Aug 2013 02:52:25 GMT
Enabling CORS <http://pouchdb.com/getting-started.html>

To replicate directly with CouchDB you need to make sure CORS is enabled,
only set the username and password if you have set them previously, by
default CouchDB will be installed in "Admin Party" and they are not needed,
you will need to replace the myname.iriscouch.com with your own host (
127.0.0.1:5984 if installed locally):

$ export HOST=http://username:password@myname.iriscouch.com$ curl -X
PUT $HOST/_config/httpd/enable_cors -d '"true"'$ curl -X PUT
$HOST/_config/cors/origins -d '"*"'$ curl -X PUT
$HOST/_config/cors/credentials -d '"true"'$ curl -X PUT
$HOST/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'$ curl
-X PUT $HOST/_config/cors/headers -d \
  '"accept, authorization, content-type, origin"'



On Thu, Aug 22, 2013 at 11:28 PM, Bin Wang <wbin00@gmail.com> wrote:

> I'm new to couchdb. But I think you can find the way in document:
>
> http://docs.couchdb.org/en/latest/config_reference.html?highlight=access
>
> 11.16. cors Configuration Options
>
> OptionDescription
> originsList of origins, separated by a comma (protocol, host, optional
> port)
> methodsaccepted HTTP methods
> credentialstrue sends additional header
> Access-Control-Allow-Credentials=true
>
> Note that credentials=true and origins=* are mutually exclusive.
>
>
> 2013/8/23 Rao, Zhiqing <zrao@qti.qualcomm.com>:
> > Hi guys,
> >
> > When I use ajax to query couchdb view from http://a.com to
> http://b.com:5984/db/_design/viewxx,
> > All the available update to date browsers would report error: "required
> Cross Origin Resource Sharing (CORS)".
> >
> > I know how to fix the CORS with IIS based website, by adding
> "Access-Control-Allow-Origin: *" to website response headers.
> > But how can I add the response header for couchdb server?
> >
> > Thanks,
> > Zhiqing
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message