Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 19480 invoked from network); 9 Jun 2009 17:22:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Jun 2009 17:22:18 -0000 Received: (qmail 67589 invoked by uid 500); 9 Jun 2009 17:21:46 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 67357 invoked by uid 500); 9 Jun 2009 17:21:45 -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 66785 invoked by uid 99); 9 Jun 2009 17:17:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jun 2009 17:17:56 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kaczmarek.w@gmail.com designates 209.85.218.218 as permitted sender) Received: from [209.85.218.218] (HELO mail-bw0-f218.google.com) (209.85.218.218) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jun 2009 17:17:48 +0000 Received: by bwz18 with SMTP id 18so187472bwz.11 for ; Tue, 09 Jun 2009 10:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=Ds4hW5uyQmO51g72RkiJ/u3q1B95QE0i+iWrKH3TzyI=; b=UfRJjCT28LHs+5vlXmHzWMjAL9Pkqf7qRViDbt+zVE1j03dd5rzLoLyRt77Xv2TCc/ qxa1zedmoq8bTFsGsJH5dmjAN6ZpwyD+pNahC3YFInxeK+xkMI0zuzSe2pjxFJO/T0t+ CjLQDK9ltEfzzunE2UIWC/tm1lhNACGyKHPRU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=JMTxjnkXJddPwoKzItGALW6Nu1AlLfJnRE3mJe1TbRaYrUN+34fh/dw7npQbpDG3Jk sUNjVVh/TeVbYF4YdMzY12oX9Yn2XNEFI54zvGAfEWbI+WOCi9jmxOFqI/AjRYB6EOw/ nDJxBx6eGZ8yZdiso+z6Z2IIhd0DDJKfuAPP4= MIME-Version: 1.0 Received: by 10.223.110.200 with SMTP id o8mr391548fap.56.1244567846722; Tue, 09 Jun 2009 10:17:26 -0700 (PDT) Date: Tue, 9 Jun 2009 19:17:26 +0200 Message-ID: <31ae10910906091017w15a07544g43e9812d8796bef0@mail.gmail.com> Subject: workaround for cross-site PUTs From: Wojciech Kaczmarek To: user Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi! I'm going to hack a Greasemonkey script which would automatically update CouchDB docs from a webpage content. It needs to be done at the browser side, server side is out of reach for modification. I can't use XMLHttpRequest as it doesn't allow cross-site requests. When using jQuery's ajax with jsonp (or whatever application of script tag injection) the requests are limited to GETs. So I'm going to have a layer in the CouchDB translating external GETs to document-writing PUTs. Is couchapp able to do this with some of its helpers or should I set up external process catching the requests and sending appropiate PUTs? (I could set up proxies or intermediate webapp instead, but I want to avoid extra infrastructure and like an idea of making stuff able to couch-replicate as much as possible; that's why external process seems heavyweight as it requires preconfiguration instead of just replication.) cheers, Wojtek