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 BD050C521 for ; Sat, 22 Jun 2013 10:26:22 +0000 (UTC) Received: (qmail 21757 invoked by uid 500); 22 Jun 2013 10:26:22 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 21725 invoked by uid 500); 22 Jun 2013 10:26:21 -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 21716 invoked by uid 99); 22 Jun 2013 10:26:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Jun 2013 10:26:21 +0000 Date: Sat, 22 Jun 2013 10:26:21 +0000 (UTC) From: "Robert Newson (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (COUCHDB-1840) Better check for public_field value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13691096#comment-13691096 ] Robert Newson commented on COUCHDB-1840: ---------------------------------------- I took the re:split method from our handling of vhost_global_handlers so, if this is deemed a bug to fix, then we should fix both. Historically, we've been fairly intolerant of bad config values on the let-it-crash principle, though there are almost certainly a bunch of one-off exceptions to this rule already. :) > Better check for public_field value > ----------------------------------- > > Key: COUCHDB-1840 > URL: https://issues.apache.org/jira/browse/COUCHDB-1840 > Project: CouchDB > Issue Type: Improvement > Reporter: Alexander Shorin > Priority: Trivial > > It's possible to run into issue COUCHDB-1838 and enable `public_fields` feature without actually specifying any public fields: > {code} > [couch_httpd_auth] > public_field = , > {code} > Because of [split code|https://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=blob;f=src/couchdb/couch_users_db.erl;h=9b875ba56d02d398049bb828015a37d219bcf6fd;hb=8d7ab8b18dd20f8785e69f4420c6f93a2edbfa60#l118]: > {code} > strip_non_public_fields(#doc{body={Props}}=Doc) -> > Public = re:split(couch_config:get("couch_httpd_auth", "public_fields", ""), > "\\s*,\\s*", [{return, binary}]), > Doc#doc{body={[{K, V} || {K, V} <- Props, lists:member(K, Public)]}}. > {code} > The parameter's value as comma (`,`) will produce empty Public list. Probably, it's better to check him for any members and/or strip all empty string members before counting `public_fields` parameter activated. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira