From eb81ff32d07cb8cbe1a13a495a2aabd968313821 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Fri, 13 Feb 2009 18:33:16 +0000 Subject: Apply COUCHDB-251. Allow _list functions to accept arbitrary GET parameters. Thanks Paul Davis. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@744210 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch_tests.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'share') diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js index e9594918..bc4e067a 100644 --- a/share/www/script/couch_tests.js +++ b/share/www/script/couch_tests.js @@ -2795,6 +2795,10 @@ db.createDb(); } } }) + }), + qsParams: stringFun(function(head, row, req, row_number) { + if(head) return {body: req.query.foo}; + else return {body: "\n"}; }) } }; @@ -2862,6 +2866,10 @@ db.createDb(); T(xhr.getResponseHeader("Content-Type") == "application/xml"); T(xhr.responseText.match(/XML/)); T(xhr.responseText.match(/entry/)); + + // now with extra qs params + xhr = CouchDB.request("GET", "/test_suite_db/_list/lists/qsParams/basicView?foo=blam"); + T(xhr.responseText.match(/blam/)); }, compact: function(debug) { -- cgit v1.2.3