couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woh...@apache.org
Subject [couchdb] branch master updated: Expose node name via /_node/_local, closes #2005 (#2006)
Date Mon, 15 Apr 2019 22:04:39 GMT
This is an automated email from the ASF dual-hosted git repository.

wohali pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
     new b1f65df  Expose node name via /_node/_local, closes #2005 (#2006)
b1f65df is described below

commit b1f65df8b1b0b425563e9b33c84bb8228de21578
Author: Joan Touzet <wohali@users.noreply.github.com>
AuthorDate: Mon Apr 15 18:04:33 2019 -0400

    Expose node name via /_node/_local, closes #2005 (#2006)
---
 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..5aa9aaf 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


Mime
View raw message