Return-Path: X-Original-To: apmail-abdera-user-archive@www.apache.org Delivered-To: apmail-abdera-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7BA2454DB for ; Thu, 12 May 2011 15:28:13 +0000 (UTC) Received: (qmail 87013 invoked by uid 500); 12 May 2011 15:28:13 -0000 Delivered-To: apmail-abdera-user-archive@abdera.apache.org Received: (qmail 86984 invoked by uid 500); 12 May 2011 15:28:13 -0000 Mailing-List: contact user-help@abdera.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@abdera.apache.org Delivered-To: mailing list user@abdera.apache.org Received: (qmail 86976 invoked by uid 99); 12 May 2011 15:28:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 May 2011 15:28:12 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rich.d.jones@googlemail.com designates 74.125.82.46 as permitted sender) Received: from [74.125.82.46] (HELO mail-ww0-f46.google.com) (74.125.82.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 May 2011 15:28:04 +0000 Received: by wwb28 with SMTP id 28so1783732wwb.3 for ; Thu, 12 May 2011 08:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=UpSwI3WyHzkgnlvQZXe5lRLY9yq8Vil47UBzwuH6uLw=; b=Q6UgVcd/sm2d1fRoWxa9wktiOnBQ/EynZJiSdYUby/ZRc22tIti5q01JQEBICfyVOB jnzKfqwR4bxpFZJwU0NPX64/37Wl3NZDc/ww3ztdVE7rSjjoU7pQaxIC7lY4LXKDE1Mo s8nVUaEa5yfx3hHyOfjjYg9MHMQypLJJDH2xg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=eaI+09bCNB+l/420s33bzQxdWjJ3U2A/34tOEEfbisoBt8YErk0GbUACHJrVWubvuD 122O/R2xXc4zQt/EMNmynhcaNmazMzFIj/NzTryHHbldsHYHB3IwEcbhlOIFG92TVvcz nN3QTMCHCh7/PeBrLDF8iJGSKGnYhBlBxEcbk= Received: by 10.216.144.166 with SMTP id n38mr1840396wej.75.1305214062861; Thu, 12 May 2011 08:27:42 -0700 (PDT) Received: from [192.168.1.12] (customer15816.pool1.Croydon-GLN2000-BAS0001.orangehomedsl.co.uk [91.104.125.207]) by mx.google.com with ESMTPS id b20sm811579wbb.16.2011.05.12.08.27.40 (version=SSLv3 cipher=OTHER); Thu, 12 May 2011 08:27:41 -0700 (PDT) Message-ID: <4DCBFC6F.2030705@gmail.com> Date: Thu, 12 May 2011 16:27:43 +0100 From: Richard Jones User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: user@abdera.apache.org CC: Alistair Miles Subject: Re: chunked Transfer-Encoding forbidden References: <4DA98E5B.1000208@gmail.com> <20110512102759.GC12838@skiathos> In-Reply-To: <20110512102759.GC12838@skiathos> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Alistair, Thanks - yes, you are right, neither Apache nor mod_wsgi enable chunked transfer encoding by default. Eventually I found the answer in a change log on the mod_wsgi scm, which allows you to turn it on :) Cheers, Richard On 12/05/11 11:28, Alistair Miles wrote: > Hi Richard, > > I'm far from an expert in either Apache or Abdera, but I'd be surprised if > Apache (at least in the default configuration) allowed posting of content > without a content-length header - I think this would be a potential denial of > service vulnerability. > > Cheers, > > Alistair > > On Sat, Apr 16, 2011 at 01:40:59PM +0100, Richard Jones wrote: >> Hi Folks, >> >> I'm a new user with Abdera, and am having some problems getting an >> Abdera client to talk to my AtomPub server running behind Apache, >> based around chunked Transfer-Encoding, and wonder if anyone can >> help. >> >> Basically, I'm executing: >> >> resp = client.execute( >> "POST", url.toString(), >> new SWORDMultipartRequestEntity(deposit), >> options); >> >> Where SWORDMultipartRequestEntity is home-baked but very similar to >> MultipartRelatedRequestEntity (it adds a few extra headers at the >> Media Part mime boundary and puts a Content-Disposition on the Entry >> Part). >> >> When I run this, I get a 411 Content-Length required response, and >> the Apache log says: >> >> chunked Transfer-Encoding forbidden: /sss/col-uri/ca0f >> >> I ran a curl command against my AtomPub server: >> >> curl -i -X POST --data-binary "@multipart.dat" >> -H 'Content-Type: >> multipart/related;boundary="===============0670350989=="' >> -H 'MIME-Version: 1.0' >> -H 'Packaging: http://purl.org/net/sword/package/default' >> http://localhost/sss/col-uri/ca0f >> >> where @multipart.dat is a mock-up of the kind of multipart/related >> request I want to make. >> >> The request was successful, and I chased it with wireshark, which >> gave me the following output: >> >> POST /sss/col-uri/ca0f HTTP/1.1 >> User-Agent: curl/7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 >> OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15 >> Host: localhost >> Accept: */* >> Content-Type: multipart/related; boundary="===============0670350989==" >> MIME-Version: 1.0 >> Packaging: http://purl.org/net/sword/package/default >> Content-Length: 49557 >> Expect: 100-continue >> >> HTTP/1.1 100 Continue >> >> So there was a 100 Continue response and then the content deposit >> went as planned. When I chase the relevant equivalent bit of code >> coming from Abdera I get: >> >> POST /sss/col-uri/ca0f HTTP/1.1 >> User-Agent: Abdera/v1.0-SNAPSHOT >> Host: localhost >> Expect: 100-continue >> Transfer-Encoding: chunked >> Content-Type: Multipart/Related; >> boundary="1302955343423";type="application/atom+xml;type=entry" >> >> HTTP/1.1 411 Length Required >> >> The Main differences I can see are: >> >> 1/ The Content-Type header from Abdera is slightly differently >> constructed (mime boundary accepted) - can't see that this is the >> problem. >> >> 2/ There is a Transfer-Encoding: chunked header rather than a >> Content-Length header in the Abdera call. This seems to be the >> culprit. >> >> >> Perhaps support for Transfer-Encoding: chunked is an option in >> Apache, or perhaps I need to set the Content-Length myself? Any >> tips gratefully appreciated. >> >> In the mean time, other than that I have to say that Abdera is a joy >> to work with - it's giving me lots of space to do the things that I >> want. >> >> All the best, >> >> Richard