summaryrefslogtreecommitdiff
path: root/share/www/script
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2009-07-11 17:00:42 +0000
committerJan Lehnardt <jan@apache.org>2009-07-11 17:00:42 +0000
commitdeae5e14975c0726feb28c7e0be433e650c40f30 (patch)
tree59b08d374742b69dcea88d42884b90090fb0bfc6 /share/www/script
parent270d1e004e3bed8fc21bbe37676292227d720dc3 (diff)
send Location header for new or updated attachments
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@793205 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script')
-rw-r--r--share/www/script/test/attachments.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/share/www/script/test/attachments.js b/share/www/script/test/attachments.js
index f89ec124..b31cfe0b 100644
--- a/share/www/script/test/attachments.js
+++ b/share/www/script/test/attachments.js
@@ -58,6 +58,10 @@ couchTests.attachments= function(debug) {
headers:{"Content-Type": "text/plain;charset=utf-8"}
});
T(xhr.status == 201);
+ TEquals("/bin_doc2/foo2.txt",
+ xhr.getResponseHeader("Location").substr(-18),
+ "should return Location header to newly created or updated attachment");
+
var rev = JSON.parse(xhr.responseText).rev;
binAttDoc2 = db.open("bin_doc2");
@@ -78,7 +82,8 @@ couchTests.attachments= function(debug) {
// test with rev, should not fail
var xhr = CouchDB.request("DELETE", "/test_suite_db/bin_doc2/foo2.txt?rev=" + rev);
T(xhr.status == 200);
-
+ TEquals(null, xhr.getResponseHeader("Location"),
+ "should not return Location header on DELETE request");
// test binary data
var bin_data = "JHAPDO*AU£PN ){(3u[d 93DQ9¡€])} ææøo'∂ƒæ≤çæππ•¥∫¶®#†π¶®¥π€ª®˙π8np";