Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B9CF492FB for ; Wed, 29 Feb 2012 11:10:42 +0000 (UTC) Received: (qmail 43020 invoked by uid 500); 29 Feb 2012 11:10:42 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 42923 invoked by uid 500); 29 Feb 2012 11:10:42 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 42903 invoked by uid 99); 29 Feb 2012 11:10:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 11:10:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Feb 2012 11:10:19 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E086D4CF7B; Wed, 29 Feb 2012 11:09:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jhs@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [4/9] git commit: Move to a strictly hostname:port vhost key Message-Id: <20120229110958.E086D4CF7B@tyr.zones.apache.org> Date: Wed, 29 Feb 2012 11:09:58 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Move to a strictly hostname:port vhost key Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/1bc8c493 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/1bc8c493 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/1bc8c493 Branch: refs/heads/COUCHDB-1416 Commit: 1bc8c493accf71fcf06418e46aadd36bdc2a42df Parents: 0ab41ad Author: Jason Smith (air) Authored: Wed Feb 29 16:58:35 2012 +0700 Committer: Jason Smith (air) Committed: Wed Feb 29 16:58:35 2012 +0700 ---------------------------------------------------------------------- share/www/script/test/rewrite.js | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/1bc8c493/share/www/script/test/rewrite.js ---------------------------------------------------------------------- diff --git a/share/www/script/test/rewrite.js b/share/www/script/test/rewrite.js index 36ab87e..0262bb6 100644 --- a/share/www/script/test/rewrite.js +++ b/share/www/script/test/rewrite.js @@ -443,7 +443,7 @@ couchTests.rewrite = function(debug) { var rw_ddoc = { _id: "_design/rwtest", rewrites: [ - {"from":"testShow","to":"_show/show_requested_path"}, + {"from":"path/testShow","to":"_show/show_requested_path"}, {"from":"_config/*","to":"../../../_config/*"} ], shows : { @@ -456,13 +456,13 @@ couchTests.rewrite = function(debug) { T(db.save(rw_ddoc).ok); // try accessing directly - var res = CouchDB.request("GET", "/test_suite_db/_design/rwtest/_rewrite/testShow"); - TEquals('/test_suite_db/_design/rwtest/_rewrite/testShow', + var res = CouchDB.request("GET", "/test_suite_db/_design/rwtest/_rewrite/path/testShow"); + TEquals('/test_suite_db/_design/rwtest/_rewrite/path/testShow', res.responseText, "requested_path should equal requested"); - // test a vhost with a path as well + // Test on a typical vhost -> _rewrite setup. var vhosts = {section:'vhosts', - key:encodeURIComponent(CouchDB.host + '/path'), + key:encodeURIComponent(CouchDB.host), value:"/test_suite_db/_design/rwtest/_rewrite/"}; run_on_modified_server([vhosts], function() { @@ -470,8 +470,8 @@ couchTests.rewrite = function(debug) { TEquals('/path/testShow', res.responseText, "requested_path should equal requested"); }); - // test a vhost on the root of the host - vhosts.key = encodeURIComponent(CouchDB.host); + // Test a vhost to a path within the rewrite namespace. + vhosts.value = "/test_suite_db/_design/rwtest/_rewrite/path"; run_on_modified_server([vhosts], function() { var res = CouchDB.request("GET", "/testShow"); TEquals('/testShow', res.responseText, "requested_path should equal requested");