summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoan Touzet <wohali@users.noreply.github.com>2019-04-15 18:04:33 -0400
committerGitHub <noreply@github.com>2019-04-15 18:04:33 -0400
commitb1f65df8b1b0b425563e9b33c84bb8228de21578 (patch)
treeef8d1e9e90705b658e343fd71d95d8607f0149db
parent91b299d04a4ded2e11fb65972984b24d3491d1aa (diff)
downloadcouchdb-b1f65df8b1b0b425563e9b33c84bb8228de21578.tar.gz
Expose node name via /_node/_local, closes #2005 (#2006)
-rw-r--r--src/chttpd/src/chttpd_misc.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/chttpd/src/chttpd_misc.erl b/src/chttpd/src/chttpd_misc.erl
index efa7ef338..5aa9aaf97 100644
--- a/src/chttpd/src/chttpd_misc.erl
+++ b/src/chttpd/src/chttpd_misc.erl
@@ -269,6 +269,8 @@ handle_uuids_req(Req) ->
% Node-specific request handler (_config and _stats)
% Support _local meaning this node
+handle_node_req(#httpd{path_parts=[_, <<"_local">>]}=Req) ->
+ send_json(Req, 200, {[{name, 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