From 1dd554d884644bbf6f5a7d07b7c8fe51feb7a4c4 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Thu, 26 Mar 2009 17:40:27 +0000 Subject: 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 --- share/www/script/test/basics.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'share') 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); -- cgit v1.2.3