Browse files

Make couch_httpd_misc_handlers:welcome_message() DbFrontend aware

Change-Id: Icbd365ca03c96a47fb828c32e544b857106540cc
Reviewed-on: http://review.couchbase.org/8988
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information...
1 parent 99184c4 commit bd72d92c2859fdbe79702a17fce19b66995be1cd @janl janl committed with alk Aug 16, 2011
Showing with 8 additions and 5 deletions.
  1. +6 −0 src/couchdb/couch_db_frontend.erl
  2. +2 −5 src/couchdb/couch_httpd_misc_handlers.erl
View
6 src/couchdb/couch_db_frontend.erl
@@ -179,3 +179,9 @@ couch_doc_open(Db, DocId, Rev, Options) ->
throw(Else)
end
end.
+
+welcome_message(WelcomeMessage) ->
+ [
+ {couchdb, WelcomeMessage},
+ {version, list_to_binary(couch_server:get_version())}
+ ].
View
7 src/couchdb/couch_httpd_misc_handlers.erl
@@ -29,11 +29,8 @@
% httpd global handlers
-handle_welcome_req(#httpd{method='GET'}=Req, WelcomeMessage) ->
- send_json(Req, {[
- {couchdb, WelcomeMessage},
- {version, list_to_binary(couch_server:get_version())}
- ]});
+handle_welcome_req(#httpd{method='GET',db_frontend=DbFrontend}=Req, WelcomeMessage) ->
+ send_json(Req, {DbFrontend:welcome_message(WelcomeMessage)});
handle_welcome_req(Req, _) ->
send_method_not_allowed(Req, "GET,HEAD").

0 comments on commit bd72d92

Please sign in to comment.