Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master 5640f8501 -> 1ee2725cf


Update welcome message to new couchdb standard


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/1ee2725c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/1ee2725c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/1ee2725c

Branch: refs/heads/master
Commit: 1ee2725cfaf1a52a2d0ba8c4f68883a9f78a625f
Parents: 5640f85
Author: Robert Newson <[email protected]>
Authored: Fri Jun 27 12:06:51 2014 +0100
Committer: Robert Newson <[email protected]>
Committed: Fri Jun 27 12:06:51 2014 +0100

----------------------------------------------------------------------
 src/chttpd_misc.erl | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/1ee2725c/src/chttpd_misc.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_misc.erl b/src/chttpd_misc.erl
index 600b6a4..0a4badf 100644
--- a/src/chttpd_misc.erl
+++ b/src/chttpd_misc.erl
@@ -35,27 +35,17 @@ handle_welcome_req(Req) ->
 handle_welcome_req(#httpd{method='GET'}=Req, WelcomeMessage) ->
     send_json(Req, {[
         {couchdb, WelcomeMessage},
-        {version, list_to_binary(couch_server:get_version())},
-        {bigcouch, get_version()}
-    ]});
+        {version, list_to_binary(couch_server:get_version())}
+        ] ++ case config:get("vendor") of
+        [] ->
+            [];
+        Properties ->
+            [{vendor, {[{?l2b(K), ?l2b(V)} || {K, V} <- Properties]}}]
+        end
+    });
 handle_welcome_req(Req, _) ->
     send_method_not_allowed(Req, "GET,HEAD").
 
-get_version() ->
-    Releases = release_handler:which_releases(),
-    Version = case [V || {"bigcouch", V, _, current} <- Releases] of
-    [] ->
-        case [V || {"bigcouch", V, _, permanent} <- Releases] of
-        [] ->
-            "dev";
-        [Permanent] ->
-            Permanent
-        end;
-    [Current] ->
-        Current
-    end,
-    list_to_binary(Version).
-
 handle_favicon_req(Req) ->
     handle_favicon_req(Req, config:get("chttpd", "docroot")).
 

Reply via email to