couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Shorin (JIRA)" <>
Subject [jira] [Created] (COUCHDB-1840) Better check for public_field value
Date Sat, 22 Jun 2013 00:55:19 GMT
Alexander Shorin created COUCHDB-1840:

             Summary: Better check for public_field value
                 Key: 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:

public_field = ,

Because of [split code|;a=blob;f=src/couchdb/couch_users_db.erl;h=9b875ba56d02d398049bb828015a37d219bcf6fd;hb=8d7ab8b18dd20f8785e69f4420c6f93a2edbfa60#l118]:
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)]}}.

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:

View raw message