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 A97AE10B7E for ; Sat, 22 Jun 2013 00:55:20 +0000 (UTC) Received: (qmail 27651 invoked by uid 500); 22 Jun 2013 00:55:20 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 27614 invoked by uid 500); 22 Jun 2013 00:55:20 -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 27605 invoked by uid 99); 22 Jun 2013 00:55:20 -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 00:55:20 +0000 Date: Sat, 22 Jun 2013 00:55:19 +0000 (UTC) From: "Alexander Shorin (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (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 Alexander Shorin created COUCHDB-1840: ----------------------------------------- Summary: 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 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