nickva commented on a change in pull request #3567:
URL: https://github.com/apache/couchdb/pull/3567#discussion_r633713265



##########
File path: src/chttpd/src/chttpd_util.erl
##########
@@ -0,0 +1,44 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(chttpd_util).
+
+
+-export([
+       get_chttpd_config/1, get_chttpd_config/2,
+       get_chttpd_auth_config/1, get_chttpd_auth_config/2
+]).
+
+
+get_chttpd_config(Key) when is_atom(Key) ->
+       case config:get("httpd", atom_to_list(Key)) of

Review comment:
       It is interesting to think about various cases of when the setting was 
locally set by a user and if they want to update it after this PR. Checking 
httpd first ensure we would always catch the user's `local.ini` setting they 
had before this PR. However, we'd want to document that if they want to update 
the setting, they will have to delete the httpd setting and set a new chttpd 
one. If they don't their new chttpd setting will be ignored.
   
   However, I think if we manage to switch all moved setting to be commented 
out in the chttpd section, like we thought about here 
https://github.com/apache/couchdb/pull/3567/files#r633678428, then we can have 
the best of both worlds! We'd check `chttpd` first, and since it will be 
`undefined` by default, we'd check the `httpd` section next. If the user wants 
to set a value, they would just set `chttpd` and forget about `httpd` 
altogether after that. But for this logic to work, we must not set the explicit 
values in `[chttpd] ...` default.ini section and always use commented out 
defaults.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to