From b67a4ec21fed0942cfeba1662eb6e00f3f3a570c Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Fri, 10 Jul 2009 01:17:15 +0000 Subject: fix attachment etags, thanks Mark Hammond for the test case. closes COUCHDB-386 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@792774 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/attachments.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'share') diff --git a/share/www/script/test/attachments.js b/share/www/script/test/attachments.js index 7204475f..5470840a 100644 --- a/share/www/script/test/attachments.js +++ b/share/www/script/test/attachments.js @@ -202,4 +202,13 @@ couchTests.attachments= function(debug) { var doc = db.open("bin_doc5", {attachments:true}); T(doc._attachments["lorem.txt"].data == lorem_b64); + // test etags for attachments. + var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc5/lorem.txt"); + T(xhr.status == 200); + var etag = xhr.getResponseHeader("etag"); + console.log(etag) + xhr = CouchDB.request("GET", "/test_suite_db/bin_doc5/lorem.txt", { + headers: {"if-none-match": etag} + }); + T(xhr.status == 304); }; -- cgit v1.2.3