Skip to content

Commit

Permalink
Make couch_httpd_misc_handlers:welcome_message() DbFrontend aware
Browse files Browse the repository at this point in the history
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
janl authored and alk committed Aug 17, 2011
1 parent 99184c4 commit bd72d92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/couchdb/couch_db_frontend.erl
Expand Up @@ -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())}
].
7 changes: 2 additions & 5 deletions src/couchdb/couch_httpd_misc_handlers.erl
Expand Up @@ -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").

Expand Down

0 comments on commit bd72d92

Please sign in to comment.