summaryrefslogtreecommitdiff
path: root/share/www
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2009-03-26 17:40:27 +0000
committerJan Lehnardt <jan@apache.org>2009-03-26 17:40:27 +0000
commit1dd554d884644bbf6f5a7d07b7c8fe51feb7a4c4 (patch)
tree44f37e75467603a54edd79280cebc22d963de60f /share/www
parent39a927058a066e7c7c31cb4388371f2c8b639e4b (diff)
return a Location header on newly created documents using PUT requests
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@758768 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www')
-rw-r--r--share/www/script/test/basics.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/share/www/script/test/basics.js b/share/www/script/test/basics.js
index ebfe5db2..7149c350 100644
--- a/share/www/script/test/basics.js
+++ b/share/www/script/test/basics.js
@@ -148,6 +148,13 @@ couchTests.basics = function(debug) {
T(locs[4] == resp.id);
T(locs[3] == "test_suite_db");
+ // document put's should return a Location header
+ var xhr = CouchDB.request("PUT", "/test_suite_db/newdoc", {
+ body: JSON.stringify({"a":1})
+ });
+ TEquals("/test_suite_db/newdoc", xhr.getResponseHeader("Location"),
+ "should return Location header to newly created document");
+
// deleting a non-existent doc should be 404
xhr = CouchDB.request("DELETE", "/test_suite_db/doc-does-not-exist");
T(xhr.status == 404);