From dev-return-20146-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Tue Jan 17 09:03:59 2012 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 8CEBB9ACD for ; Tue, 17 Jan 2012 09:03:59 +0000 (UTC) Received: (qmail 92837 invoked by uid 500); 17 Jan 2012 09:03:59 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 92559 invoked by uid 500); 17 Jan 2012 09:03: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 92545 invoked by uid 99); 17 Jan 2012 09:03:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2012 09:03:53 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dave@muse.net.nz designates 209.85.212.52 as permitted sender) Received: from [209.85.212.52] (HELO mail-vw0-f52.google.com) (209.85.212.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2012 09:03:46 +0000 Received: by vbbez10 with SMTP id ez10so1504007vbb.11 for ; Tue, 17 Jan 2012 01:03:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.76.196 with SMTP id m4mr7514658vdw.112.1326791005343; Tue, 17 Jan 2012 01:03:25 -0800 (PST) Received: by 10.52.112.4 with HTTP; Tue, 17 Jan 2012 01:03:25 -0800 (PST) X-Originating-IP: [84.172.65.208] In-Reply-To: References: <20120115224552.15FA055BC3@tyr.zones.apache.org> Date: Tue, 17 Jan 2012 10:03:25 +0100 Message-ID: Subject: Re: git commit: Use non-compressed Content-Type in attachments test suites From: Dave Cottlehuber To: dev@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 16 January 2012 15:56, Benoit Chesneau wrote: > On Sun, Jan 15, 2012 at 2:45 PM, =C2=A0 wrote: >> Updated Branches: >> =C2=A0refs/heads/1.2.x e8688ac20 -> 8d83b39a0 >> >> >> Use non-compressed Content-Type in attachments test suites >> >> MD5-Digests of attachments are calculated on the compressed data if the >> attachment MIME type is compressible, as defined in default.ini >> [attachments] compressible_types >> >> Windows uses a different gzip implementation, and therefore generates >> different MD5-Digests than other platforms. Using binary Content-Type >> resolves this. >> >> >> Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo >> Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/8d83b39a >> Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/8d83b39a >> Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/8d83b39a >> >> Branch: refs/heads/1.2.x >> Commit: 8d83b39a061eb12956aa9574b27044a423bbcb93 >> Parents: e8688ac >> Author: Dave Cottlehuber >> Authored: Sun Jan 15 23:38:13 2012 +0100 >> Committer: Dave Cottlehuber >> Committed: Sun Jan 15 23:38:13 2012 +0100 >> >> ---------------------------------------------------------------------- >> =C2=A0share/www/script/test/attachment_names.js | =C2=A0 =C2=A06 +++--- >> =C2=A0share/www/script/test/attachments.js =C2=A0 =C2=A0 =C2=A0| =C2=A0 = 10 +++++++--- >> =C2=A02 files changed, 10 insertions(+), 6 deletions(-) >> ---------------------------------------------------------------------- >> >> >> http://git-wip-us.apache.org/repos/asf/couchdb/blob/8d83b39a/share/www/s= cript/test/attachment_names.js >> ---------------------------------------------------------------------- >> diff --git a/share/www/script/test/attachment_names.js b/share/www/scrip= t/test/attachment_names.js >> index 78c95de..334350c 100644 >> --- a/share/www/script/test/attachment_names.js >> +++ b/share/www/script/test/attachment_names.js >> @@ -20,7 +20,7 @@ couchTests.attachment_names =3D function(debug) { >> =C2=A0 =C2=A0 _id: "good_doc", >> =C2=A0 =C2=A0 _attachments: { >> =C2=A0 =C2=A0 =C2=A0 "=D0=9A=D0=BE=D0=BB=D1=8F=D0=BD.txt": { >> - =C2=A0 =C2=A0 =C2=A0 content_type:"text/plain", >> + =C2=A0 =C2=A0 =C2=A0 content_type:"application/octet-stream", >> =C2=A0 =C2=A0 =C2=A0 =C2=A0data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleH= Q=3D" >> =C2=A0 =C2=A0 =C2=A0 } >> =C2=A0 =C2=A0 } >> @@ -31,8 +31,8 @@ couchTests.attachment_names =3D function(debug) { >> >> =C2=A0 var xhr =3D CouchDB.request("GET", "/test_suite_db/good_doc/=D0= =9A=D0=BE=D0=BB=D1=8F=D0=BD.txt"); >> =C2=A0 T(xhr.responseText =3D=3D "This is a base64 encoded text"); >> - =C2=A0T(xhr.getResponseHeader("Content-Type") =3D=3D "text/plain"); >> - =C2=A0TEquals("\"qUUYqS41RhwF0TrCsTAxFg=3D=3D\"", xhr.getResponseHeade= r("Etag")); >> + =C2=A0T(xhr.getResponseHeader("Content-Type") =3D=3D "application/octe= t-stream"); >> + =C2=A0TEquals("\"aEI7pOYCRBLTRQvvqYrrJQ=3D=3D\"", xhr.getResponseHeade= r("Etag")); >> >> =C2=A0 var binAttDoc =3D { >> =C2=A0 =C2=A0 _id: "bin_doc", >> >> http://git-wip-us.apache.org/repos/asf/couchdb/blob/8d83b39a/share/www/s= cript/test/attachments.js >> ---------------------------------------------------------------------- >> diff --git a/share/www/script/test/attachments.js b/share/www/script/tes= t/attachments.js >> index a409f82..db4524a 100644 >> --- a/share/www/script/test/attachments.js >> +++ b/share/www/script/test/attachments.js >> @@ -16,11 +16,15 @@ couchTests.attachments=3D function(debug) { >> =C2=A0 db.createDb(); >> =C2=A0 if (debug) debugger; >> >> + >> + =C2=A0// MD5 Digests of compressible attachments and therefore Etags >> + =C2=A0// will vary depending on platform gzip implementation. >> + =C2=A0// These MIME types are defined in [attachments] compressible_ty= pes >> =C2=A0 var binAttDoc =3D { >> =C2=A0 =C2=A0 _id: "bin_doc", >> =C2=A0 =C2=A0 _attachments:{ >> =C2=A0 =C2=A0 =C2=A0 "foo.txt": { >> - =C2=A0 =C2=A0 =C2=A0 =C2=A0content_type:"text/plain", >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0content_type:"application/octet-stream", >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 data: "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRle= HQ=3D" >> =C2=A0 =C2=A0 =C2=A0 } >> =C2=A0 =C2=A0 } >> @@ -31,8 +35,8 @@ couchTests.attachments=3D function(debug) { >> >> =C2=A0 var xhr =3D CouchDB.request("GET", "/test_suite_db/bin_doc/foo.tx= t"); >> =C2=A0 T(xhr.responseText =3D=3D "This is a base64 encoded text"); >> - =C2=A0T(xhr.getResponseHeader("Content-Type") =3D=3D "text/plain"); >> - =C2=A0TEquals("\"qUUYqS41RhwF0TrCsTAxFg=3D=3D\"", xhr.getResponseHeade= r("Etag")); >> + =C2=A0T(xhr.getResponseHeader("Content-Type") =3D=3D "application/octe= t-stream"); >> + =C2=A0TEquals("\"aEI7pOYCRBLTRQvvqYrrJQ=3D=3D\"", xhr.getResponseHeade= r("Etag")); >> >> =C2=A0 // empty attachment >> =C2=A0 var binAttDoc2 =3D { >> > > Hum tests are fixed but what about general usage? Should people always > use binary ct ? > > - beno=C3=AEt Hi Beno=C3=AEt, I'm adding a JIRA to check that we do actually generate a different MD5 if the underlying data is changed. I don't see a way from the browser side to confirm if the digest is sensible, effectively client side this will be seen as an opaque value. A+ Dave