Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A4E3F79B6 for ; Sun, 2 Oct 2011 03:48:59 +0000 (UTC) Received: (qmail 17553 invoked by uid 500); 2 Oct 2011 03:48:58 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 17378 invoked by uid 500); 2 Oct 2011 03:48:58 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 17329 invoked by uid 99); 2 Oct 2011 03:48:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Oct 2011 03:48:56 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Oct 2011 03:48:54 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id F2FD62A4A4C for ; Sun, 2 Oct 2011 03:48:33 +0000 (UTC) Date: Sun, 2 Oct 2011 03:48:33 +0000 (UTC) From: "Benoit Chesneau (Commented) (JIRA)" To: dev@couchdb.apache.org Message-ID: <1381022029.939.1317527313997.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <672355240.31521.1316106489039.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (COUCHDB-1285) Allow configuration of vendor and module version in the welcome message MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1285?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13= 118955#comment-13118955 ]=20 Benoit Chesneau commented on COUCHDB-1285: ------------------------------------------ @benjamin though url & logos are wrong here ;) iit should be http://refuge.= io . anyway I would suggest rather : vendors: [=C2=A0{"name": "somevendor", "version": ...}, ...]=C2=A0 or vendors: [{"vendorname": {=C2=A0"version": ...}=C2=A0] not sure what's the best.=20 - benoit =20 > Allow configuration of vendor and module version in the welcome message > ----------------------------------------------------------------------- > > Key: COUCHDB-1285 > URL: https://issues.apache.org/jira/browse/COUCHDB-1285 > Project: CouchDB > Issue Type: Improvement > Reporter: Jan Lehnardt > Attachments: vendor_and_modules_objects.patch > > > The patch below allows to configure vendor and module version information= into the GET / welcome message. > E.g. > [vendor] > name =3D refuge > version =3D 2.0.0 > =20 > [modules] > geocouch =3D 1.2.1 > would produce: > {"couchdb":"Welcome","version":"1.2.0","refuge":"2.0.0","modules":{"geo= couch":"1.2.1"}} > -- > --- a/src/couchdb/couch_httpd_misc_handlers.erl > +++ b/src/couchdb/couch_httpd_misc_handlers.erl > @@ -30,9 +30,23 @@ > % httpd global handlers > =20 > handle_welcome_req(#httpd{method=3D'GET'}=3DReq, WelcomeMessage) -> > + Vendor =3D case couch_config:get("vendor") of > + [] -> []; > + Vendor1 -> [{ > + proplists:get_value("name", Vendor1), > + ?l2b(proplists:get_value("version", Vendor1)) > + }] > + end, > + > + Modules =3D lists:map(fun({Key, Value}) -> > + {Key, ?l2b(Value)} > + end, couch_config:get("modules")), > + > send_json(Req, {[ > {couchdb, WelcomeMessage}, > - {version, list_to_binary(couch_server:get_version())} > + {version, list_to_binary(couch_server:get_version())}] > + ++ Vendor > + ++ [{modules, {Modules}} > ]}); > handle_welcome_req(Req, _) -> > send_method_not_allowed(Req, "GET,HEAD"). > --=20 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira