Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BDDFFD41B for ; Thu, 1 Nov 2012 06:16:54 +0000 (UTC) Received: (qmail 76414 invoked by uid 500); 1 Nov 2012 06:16:53 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 76337 invoked by uid 500); 1 Nov 2012 06:16:53 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 76326 invoked by uid 99); 1 Nov 2012 06:16:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2012 06:16:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bchesneau@gmail.com designates 209.85.210.180 as permitted sender) Received: from [209.85.210.180] (HELO mail-ia0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2012 06:16:46 +0000 Received: by mail-ia0-f180.google.com with SMTP id f6so1628802iag.11 for ; Wed, 31 Oct 2012 23:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=iTNWgwHN3VDbmvMK7tlXcqpiRpS9G200GKQF3bfLkDs=; b=Z+lAdUnHEWe6F4U6fXnVCJqf8R0xwIkCjANuBhcbzTa9jM1VYetOfo2ijLWn8nuOXQ +rEI8CPOCq64KicotJJtBI0ujv4yoGr87h7/vAe1Lxl7fcPIsYmJVfPDLLjA4hH7oNzu 7pcck7K1qi+tCTOU6+aZ9tTTyAcnFltea5gePG2dKMG56iQUHhtL3Np7goXEat64le3o z9znu4m7KU/5OKBYzOzHnSsiqNDTIOv2zAL56bteF2FaxOAe7znyy3+vK8zXu7ekUlVK hqB1x/A255OYF1CpdAi416nFGHweMhKFiWEJZZHGXqBCi83V4ffkxd5LyBk9eKshlGFO eufg== MIME-Version: 1.0 Received: by 10.50.7.135 with SMTP id j7mr209616iga.34.1351750585755; Wed, 31 Oct 2012 23:16:25 -0700 (PDT) Received: by 10.64.77.196 with HTTP; Wed, 31 Oct 2012 23:16:25 -0700 (PDT) In-Reply-To: References: Date: Thu, 1 Nov 2012 07:16:25 +0100 Message-ID: Subject: Re: CORS support From: Benoit Chesneau To: "dev@couchdb.apache.org" Content-Type: multipart/alternative; boundary=f46d044472d57d28d804cd68f544 X-Virus-Checked: Checked by ClamAV on apache.org --f46d044472d57d28d804cd68f544 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable and the branch is now named 431-feature_cors . On Thu, Nov 1, 2012 at 12:52 AM, Benoit Chesneau wrote= : > Hello all, > > So I finally committed my patch about CORS support following the current > W3C working draft [1]. This patch support simple and preflights requests > for a couchdb node. Configuration can also be done for a specific vhost. > > To enable CORS you need to set the option `cors_enable =3D true` (by > default cors is disable). All origins are matched by default. > > To configure defaults cors settings you need to create the [cors] section > in the ini file: > > [cors] > allows_credentials =3D false > ; List of origins separated by a comma > ;origins =3D > ; List of accepted headers separated by a comma > ; headers =3D > ; List of accepted methods > ; methods =3D > > allows credentials allows you to accept connections to protected dbs and > nodes. > > > To set the options for a vhosts you will need to create a section with th= e > vhost name prefixed by "cors:" . Ex for the vhost example.com: > > ; Configuration for a vhost > :[cors:example.com] > ; allows_credentials =3D false > ; List of origins separated by a comma > ;origins =3D > ; List of accepted headers separated by a comma > ; headers =3D > ; List of accepted methods > ; methods =3D > > Some tests have been added but we need to increase their number to be sur= e > to cover all the features presented here. > > Anyway please tests, and let me know. This feature is available in the > branch COUCHDB-431_cors: > > Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/0777262f > > Please test and let me know. > > - beno=EEt > > > [1] http://www.w3.org/TR/cors/#preflight-request > --f46d044472d57d28d804cd68f544--