You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2014/10/30 15:32:35 UTC
couchdb commit: updated refs/heads/master to 67f115e
Repository: couchdb
Updated Branches:
refs/heads/master ba60b24a4 -> 67f115e3e
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/master
Commit: 67f115e3ede1297d1a1086b321afc7fe424fdada
Parents: ba60b24
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sat Oct 25 15:26:11 2014 +0200
Committer: Robert Kowalski <ro...@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");
}