couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [02/50] [abbrv] couchdb commit: updated refs/heads/goodbye-futon to 393108c
Date Fri, 14 Nov 2014 17:23:07 GMT
Add integration-test for newlines in location header

COUCHDB-708


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/67f115e3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/67f115e3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/67f115e3

Branch: refs/heads/goodbye-futon
Commit: 67f115e3ede1297d1a1086b321afc7fe424fdada
Parents: ba60b24
Author: Robert Kowalski <rok@kowalski.gd>
Authored: Sat Oct 25 15:26:11 2014 +0200
Committer: Robert Kowalski <robertkowalski@apache.org>
Committed: Thu Oct 30 15:30:50 2014 +0100

----------------------------------------------------------------------
 share/www/script/test/http.js | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/67f115e3/share/www/script/test/http.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/http.js b/share/www/script/test/http.js
index 5f46af5..21c42a0 100644
--- a/share/www/script/test/http.js
+++ b/share/www/script/test/http.js
@@ -51,4 +51,29 @@ couchTests.http = function(debug) {
         xhr.getResponseHeader("Location"),
         "should include X-Host");
     });
+
+  // COUCHDB-708: newlines document names
+  xhr = CouchDB.request("PUT", "/test_suite_db/docid%0A/attachment.txt", {
+    headers: {"Content-Type": "text/plain;charset=utf-8"},
+    body: ""
+  });
+  TEquals(CouchDB.protocol + host + "/test_suite_db/docid%0A/attachment.txt",
+    xhr.getResponseHeader("Location"),
+    "should work with newlines in document names for attachments");
+
+  xhr = CouchDB.request("PUT", "/test_suite_db/docidtest%0A", {
+    body: JSON.stringify({"foo": "bar"}),
+    headers: {"Content-Type": "application/json"}
+  });
+  TEquals(CouchDB.protocol + host + "/test_suite_db/docidtest%0A",
+    xhr.getResponseHeader("Location"),
+    "should work with newlines in document names");
+
+  xhr = CouchDB.request("POST", "/test_suite_db/", {
+    body: JSON.stringify({"_id": "docidtestpost%0A"}),
+    headers: {"Content-Type": "application/json"}
+  });
+  TEquals(CouchDB.protocol + host + "/test_suite_db/docidtestpost%250A",
+    xhr.getResponseHeader("Location"),
+    "should work with newlines in document names");
 }


Mime
View raw message