diff options
author | Joan Touzet <joant@atypical.net> | 2017-10-25 22:46:36 -0400 |
---|---|---|
committer | Joan Touzet <wohali@users.noreply.github.com> | 2017-10-31 22:52:10 -0400 |
commit | bf29111f315c3b480d23c80beea66856cc992772 (patch) | |
tree | 0fceecd8ab2586814bbe111ca0e49c816f6af41f | |
parent | c2d970108b21efadc0f4fc4b0b42d0ddc5fe3c66 (diff) | |
download | couchdb-bf29111f315c3b480d23c80beea66856cc992772.tar.gz |
Alias /_node/_local/... to /_node/<nodename>@<hostname>/...
Closes #824
-rw-r--r-- | src/chttpd/src/chttpd_misc.erl | 5 | ||||
-rw-r--r-- | 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 fefb85284..15eabbfbd 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 6ff3005f6..c325d68be 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); }; |