couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woh...@apache.org
Subject [couchdb] 01/01: Alias /_node/_local/... to /_node/<nodename>@<hostname>/...
Date Thu, 26 Oct 2017 04:13:19 GMT
This is an automated email from the ASF dual-hosted git repository.

wohali pushed a commit to branch 824-node-local
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit fa11abea605de0f722f4349dc0a65826fa0d10ea
Author: Joan Touzet <joant@atypical.net>
AuthorDate: Wed Oct 25 22:46:36 2017 -0400

    Alias /_node/_local/... to /_node/<nodename>@<hostname>/...
    
    Closes #824
---
 src/chttpd/src/chttpd_misc.erl | 5 +++--
 test/javascript/couch.js       | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/chttpd/src/chttpd_misc.erl b/src/chttpd/src/chttpd_misc.erl
index fefb852..15eabbf 100644
--- a/src/chttpd/src/chttpd_misc.erl
+++ b/src/chttpd/src/chttpd_misc.erl
@@ -228,8 +228,9 @@ handle_uuids_req(Req) ->
 
 
 % Node-specific request handler (_config and _stats)
-
-
+% Support _local meaning this node
+handle_node_req(#httpd{path_parts=[A, <<"_local">>|Rest]}=Req) ->
+    handle_node_req(Req#httpd{path_parts=[A, node()] ++ Rest});
 % GET /_node/$node/_config
 handle_node_req(#httpd{method='GET', path_parts=[_, Node, <<"_config">>]}=Req)
->
     Grouped = lists:foldl(fun({{Section, Key}, Value}, Acc) ->
diff --git a/test/javascript/couch.js b/test/javascript/couch.js
index 6ff3005..c325d68 100644
--- a/test/javascript/couch.js
+++ b/test/javascript/couch.js
@@ -475,7 +475,7 @@ CouchDB.requestStats = function(path, test) {
     query_arg = "?flush=true";
   }
 
-  var url = "/_node/node1@127.0.0.1/_stats/" + path.join("/") + query_arg;
+  var url = "/_node/_local/_stats/" + path.join("/") + query_arg;
   var stat = CouchDB.request("GET", url).responseText;
   return JSON.parse(stat);
 };

-- 
To stop receiving notification emails like this one, please contact
"commits@couchdb.apache.org" <commits@couchdb.apache.org>.

Mime
View raw message