couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woh...@apache.org
Subject [couchdb] 01/01: Expose node name via /_node/_local, closes #2005
Date Fri, 12 Apr 2019 16:29:30 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 2d8366b8d560aa49da3a09b90c007254dba7cb2f
Author: Joan Touzet <joant@atypical.net>
AuthorDate: Fri Apr 12 12:16:10 2019 -0400

    Expose node name via /_node/_local, closes #2005
---
 src/chttpd/src/chttpd_misc.erl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/chttpd/src/chttpd_misc.erl b/src/chttpd/src/chttpd_misc.erl
index efa7ef3..485fb52 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, 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


Mime
View raw message