summaryrefslogtreecommitdiff
path: root/share/www
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2009-09-15 13:04:10 +0000
committerJan Lehnardt <jan@apache.org>2009-09-15 13:04:10 +0000
commitfc201b8869eb22cd1ef39d11bf945283c439059c (patch)
tree8a7f1429f9e21f80617ba231e8cc12e4d5338c86 /share/www
parentf96fee2d02a222395909810b3741400f2c9652be (diff)
fix attachments with an undefined Content-Length header and no TE, patch by Benoit Chesneau, closes COUCHDB-497
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@815308 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www')
-rw-r--r--share/www/script/test/attachments.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/share/www/script/test/attachments.js b/share/www/script/test/attachments.js
index f279c31e..1ed81ad8 100644
--- a/share/www/script/test/attachments.js
+++ b/share/www/script/test/attachments.js
@@ -225,4 +225,16 @@ couchTests.attachments= function(debug) {
headers: {"if-none-match": etag}
});
T(xhr.status == 304);
+
+ // test COUCHDB-497 - empty attachments
+ var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc5/empty.txt?rev="+rev, {
+ headers:{"Content-Type":"text/plain;charset=utf-8", "Content-Length": "0"},
+ body:""
+ });
+ TEquals(201, xhr.status, "should send 201 Accepted");
+ var rev = JSON.parse(xhr.responseText).rev;
+ var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc5/empty.txt?rev="+rev, {
+ headers:{"Content-Type":"text/plain;charset=utf-8"}
+ });
+ TEquals(201, xhr.status, "should send 201 Accepted");
};