couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Newson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1840) Better check for public_field value
Date Sat, 22 Jun 2013 10:26:21 GMT

    [ 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

Mime
View raw message