diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-07-04 16:19:23 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-07-04 16:19:23 +0000 |
commit | 887955a951470a9dc211c6e404905292f1a39585 (patch) | |
tree | 2b9c8730672938316cba1c525438dba86a04f398 /share/www/script/test | |
parent | f6fd760c17cb5d5d49211be4b4ff92e797e83157 (diff) |
send utf-8 hearders with list and show responses. closes COUCHDB-392
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@791145 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test')
-rw-r--r-- | share/www/script/test/list_views.js | 2 | ||||
-rw-r--r-- | share/www/script/test/show_documents.js | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/share/www/script/test/list_views.js b/share/www/script/test/list_views.js index 2b7e4cb3..bbe0814c 100644 --- a/share/www/script/test/list_views.js +++ b/share/www/script/test/list_views.js @@ -312,7 +312,7 @@ couchTests.list_views = function(debug) { "Accept": 'text/html' } }); - T(xhr.getResponseHeader("Content-Type") == "text/html"); + T(xhr.getResponseHeader("Content-Type") == "text/html; charset=utf-8"); T(xhr.responseText.match(/HTML/)); T(xhr.responseText.match(/Value/)); diff --git a/share/www/script/test/show_documents.js b/share/www/script/test/show_documents.js index 18dcc0b3..64a6788f 100644 --- a/share/www/script/test/show_documents.js +++ b/share/www/script/test/show_documents.js @@ -143,10 +143,7 @@ couchTests.show_documents = function(debug) { // hello template world xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/hello/"+docid); T(xhr.responseText == "Hello World"); -// -// }; -// -// function foo() { + T(/charset=utf-8/.test(xhr.getResponseHeader("Content-Type"))) // Fix for COUCHDB-379 T(equals(xhr.getResponseHeader("Server").substr(0,7), "CouchDB")); @@ -207,7 +204,8 @@ couchTests.show_documents = function(debug) { xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/accept-switch/"+docid, { headers: {"Accept": "text/html;text/plain;*/*"} }); - T("text/html" == xhr.getResponseHeader("Content-Type")); + var ct = xhr.getResponseHeader("Content-Type"); + T(/text\/html/.test(ct)) T("Accept" == xhr.getResponseHeader("Vary")); var etag = xhr.getResponseHeader("etag"); @@ -287,7 +285,9 @@ couchTests.show_documents = function(debug) { "Accept": 'text/html,application/atom+xml; q=0.9' } }); - T(xhr.getResponseHeader("Content-Type") == "text/html"); + var ct = xhr.getResponseHeader("Content-Type"); + T(/charset=utf-8/.test(ct)) + T(/text\/html/.test(ct)) T(xhr.responseText == "Ha ha, you said \"plankton\"."); // now with xml @@ -315,7 +315,9 @@ couchTests.show_documents = function(debug) { "Accept": 'text/html,application/atom+xml; q=0.9' } }); - T(xhr.getResponseHeader("Content-Type") == "text/html"); + var ct = xhr.getResponseHeader("Content-Type"); + T(/charset=utf-8/.test(ct)) + T(/text\/html/.test(ct)) T(xhr.responseText == "Ha ha, you said \"plankton\"."); // test inclusion of conflict state |