diff options
author | Damien F. Katz <damien@apache.org> | 2009-05-29 03:29:25 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2009-05-29 03:29:25 +0000 |
commit | 5e2db72572299ac4a03c762ab2ee87f53c42b518 (patch) | |
tree | 58077adaa225a4c750d6f689c2ee36537e2304af /share/www/script/test/attachments.js | |
parent | 495cf53ca4a1139c724012d63c4e0cf08299266b (diff) |
Fix and test for COUCHDB-366, uploading large attachments causes 500 error.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@779824 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/attachments.js')
-rw-r--r-- | share/www/script/test/attachments.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/share/www/script/test/attachments.js b/share/www/script/test/attachments.js index ec59eda4..e68cd444 100644 --- a/share/www/script/test/attachments.js +++ b/share/www/script/test/attachments.js @@ -181,5 +181,20 @@ couchTests.attachments= function(debug) { // Compaction should reduce the database slightly, but not // orders of magnitude (unless attachments introduce sparseness) T(after > before * 0.1, "before: " + before + " after: " + after); + + + // test large attachments - COUCHDB-366 + var lorem = CouchDB.request("GET", "/_utils/script/test/lorem.txt").responseText; + + var xhr = CouchDB.request("PUT", "/test_suite_db/bin_doc5/lorem.txt", { + headers:{"Content-Type":"text/plain;charset=utf-8"}, + body:lorem + }); + T(xhr.status == 201); + var rev = JSON.parse(xhr.responseText).rev; + + var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc5/lorem.txt"); + T(xhr.responseText == lorem); + T(xhr.getResponseHeader("Content-Type") == "text/plain;charset=utf-8"); }; |