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 90256DE89 for ; Thu, 1 Nov 2012 01:00:55 +0000 (UTC) Received: (qmail 62767 invoked by uid 500); 1 Nov 2012 01:00:55 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 62707 invoked by uid 500); 1 Nov 2012 01:00:55 -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 62699 invoked by uid 99); 1 Nov 2012 01:00:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2012 01:00:55 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.212.170] (HELO mail-wi0-f170.google.com) (209.85.212.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Nov 2012 01:00:46 +0000 Received: by mail-wi0-f170.google.com with SMTP id hm2so3934340wib.5 for ; Wed, 31 Oct 2012 18:00:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=E3YOv7feHnQIvgqFiDZqnA0xYX/1iVsTCN7GxsUjrEY=; b=N7ZBozaE6DV2sGKcr9GIfxxAUdhtcScbm4yu4mGlKTKUjm4qE6QgQdqWFibzFO64i6 SeLozu31VfNWPonj+JKaUSvUCkzlvwpcoviN9ua6+QpQjUPEfffQDr+LUkkvMVx+qTQF w+RkEx1mXSXZ1nBGpEz2cUxEcLa85PlcgB7sHhcrvHaniY/Xq4U/Y/L7kkuEWm6WfG1Z QuTuo9e91vBZWZA4y196qRzFSajtX2Vu8ebQKM1iVVSnd0ZSea6B83pKzzI9sXURIJV5 rJlUyEht5fthCNOEL7GkZd5GaY9BSy+MUEVegwi+9CnpSasNtN2mWfeyvJN4i6ALdR9N SAsg== MIME-Version: 1.0 Received: by 10.180.90.201 with SMTP id by9mr5230509wib.5.1351731624992; Wed, 31 Oct 2012 18:00:24 -0700 (PDT) Received: by 10.194.110.69 with HTTP; Wed, 31 Oct 2012 18:00:24 -0700 (PDT) In-Reply-To: References: Date: Thu, 1 Nov 2012 01:00:24 +0000 Message-ID: Subject: Re: CORS support From: Dale Harvey To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=f46d0438eba956ded704cd648b0b X-Gm-Message-State: ALoCoQl0Vwo7dUUkr7v8TTeuijknmZNaIJRkNAXoMSuagI6KRKf7u8+tqFgiJuy8zMzO6stWD9lf X-Virus-Checked: Checked by ClamAV on apache.org --f46d0438eba956ded704cd648b0b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This is awesome, thanks benoitc (and sorry for dropping the ball on this) Will test it out and get back to you On 31 October 2012 23:52, 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 def= ault > 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 > --f46d0438eba956ded704cd648b0b--