Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 57913 invoked from network); 16 Oct 2010 00:23:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Oct 2010 00:23:04 -0000 Received: (qmail 38832 invoked by uid 500); 16 Oct 2010 00:23:03 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 38796 invoked by uid 500); 16 Oct 2010 00:23:03 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 38788 invoked by uid 99); 16 Oct 2010 00:23:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Oct 2010 00:23:03 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mikeal.rogers@gmail.com designates 209.85.216.180 as permitted sender) Received: from [209.85.216.180] (HELO mail-qy0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Oct 2010 00:22:58 +0000 Received: by qyk1 with SMTP id 1so1642178qyk.11 for ; Fri, 15 Oct 2010 17:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=+bGD9WBvntO6GcJpr0+nsY1dYI2Mj0ht7IHiDs+u5v8=; b=FyhoDT5TzlLjRniV+EKoHB8R3tCk1mYDm9kj1ajnqWqQA35K2vcGkAntZyCjyoaeTX ZNcc8vYnwK2R3N8+vCdyj6KpqS1nPh0uuhzOpn/HKvJNAD4/8Q0wu7CZ7RSBR6idwwox d/Cejs16y/SqpLiCD7SX5j90Ewb2s4pIETU50= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=S26rwLWuznoJbG3DEchazGQNfSkgDp86tUVq4LrTvOBEJji6Wb1R/UyesOMEg+wYlr /LjCm/5MEYNDkYejUkQAwKF4XMFxwg54JHESIpkl4xCLk+D6vpQiOehXMwmLtEvb7eyg oLN+2taUika2/yTLM5jipbd4/2FKIS6/OZ2Ds= MIME-Version: 1.0 Received: by 10.229.224.148 with SMTP id io20mr1332189qcb.88.1287188558096; Fri, 15 Oct 2010 17:22:38 -0700 (PDT) Received: by 10.229.183.130 with HTTP; Fri, 15 Oct 2010 17:22:38 -0700 (PDT) In-Reply-To: <1BB0D011-FEA7-41D6-88F9-1EDC9D3B009A@thisonejustforme.com> References: <367552.30084.qm@web58308.mail.re3.yahoo.com> <7CE77B75-EED5-496A-B0E1-C0957660D3BD@thisonejustforme.com> <1BB0D011-FEA7-41D6-88F9-1EDC9D3B009A@thisonejustforme.com> Date: Fri, 15 Oct 2010 17:22:38 -0700 Message-ID: Subject: Re: JavaScript and CouchDB From: Mikeal Rogers To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=00163630febdc3a8e60492b0f047 --00163630febdc3a8e60492b0f047 Content-Type: text/plain; charset=ISO-8859-1 You can't do cross domain POST without proper Access Control headers which we don't support. I sent an email to the dev list recently about adding support but it hasn't gone anywhere yet. JSONP can be enabled for GET requests. Browser won't let you do POST or PUT. -Mikeal On Fri, Oct 15, 2010 at 5:11 PM, Tracy Flynn wrote: > Does 'disable by default' mean it's disabled in the default configuration > but could be turned on if the configuration/compilation option is known? Or > that it's simply not available? > > If it's truly disabled, then the only solution I can see is to introduce a > proxy that allows a JSON Post (with appropriate security) and then turn > around and do the appropriate operations on CouchDB using permitted HTTP > operations. > > I'm thinking my way around an associated issue. Some of the feeds I'm > supporting with CouchDB are paid, some are public. The only way I've so far > figured out to protect the 'for pay' feeds and provide metering is to > introduce a proxy in front of CouchDB to perform those functions. > > > On Oct 15, 2010, at 8:01 PM, Mikeal Rogers wrote: > > > This is standardized as JSONP which we disable by default because of > > security implications. This only works for GET, doesn't work for PUT. > > > > On Fri, Oct 15, 2010 at 4:58 PM, Tracy Flynn > > wrote: > > > >> Fabio > >> > >> You might consider the work-around offered by jQuery 1.4.x to the > >> same-origin problem. > >> > >> In a nutshell, they package all Ajax-like requests as a request for a > >> resource - think image or javascript file - which does NOT have the > >> limitations of the same-origin policy - and then 'unpack' the result and > >> make it available to the client as if the 'Ajax-like' request had been > >> issued directly. > >> > >> > >> A fragment like the following does the trick > >> > >> > >> > >> > >> > >> JSON Call Test Page > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> The call that services the 'some.js' request just needs to return > whatever > >> JSON data you want the call to return. Since it's requesting a resource, > and > >> not really making an Ajax call - all is well. > >> > >> If HTML isn't what you want, you could pass back Javascript embedded in > a > >> JSON structure, and then evaluate the result. I've done that > successfully > >> too. > >> > >> Works like a charm where I've used the facility. > >> > >> Tracy > >> > >> > >> On Oct 15, 2010, at 2:41 PM, Paul Davis wrote: > >> > >>> You'll need to read up on the Same Origin Policy: > >>> > >>> http://en.wikipedia.org/wiki/Same_origin_policy > >>> > >>> > >>> On Fri, Oct 15, 2010 at 2:34 PM, Fabio Batalha C Santos Santos > >>> wrote: > >>>> Hello everybody, > >>>> > >>>> I'm newby in couchDB. > >>>> > >>>> > >>>> I'm trying to develop a "Google Analytics" like applications storing > >> access log > >>>> metadata in a CouchDB database. Take a look at > >>>> > http://github.com/fabiobatalha/Analytics---CouchDB/tree/master/logger/ > >>>> > >>>> The idea is: > >>>> > >>>> Create a logger JavaScript that will be responsible to register all > >> accesslog > >>>> metadata in a CouchDB database. It works like the ga.js Google > Anaytics. > >> In the > >>>> bottom of each page will hava a call to a JavaScript function that > will > >> make use > >>>> of couch.js functions to register logaccess metadata in CouchDB > >>>> > >>>> The problem: > >>>> > >>>> I'm trying to make use of the couch.js script but the couch.js on > works > >> if the > >>>> request is made from the same host and port were the CouchDB is > >> installed. > >>>> Instead of it, my application is in a different host. How can I > >> configure the > >>>> connection to the couchDB using the couch.js > >>>> > >>>> > >>>> Thanks in advance. > >>>> Fabio Batalha > >>>> > >>>> > >>>> > >>>> > >> > >> > > --00163630febdc3a8e60492b0f047--