Github user eiri commented on a diff in the pull request:
https://github.com/apache/couchdb-chttpd/pull/101#discussion_r53058948
--- Diff: src/chttpd_cors.erl ---
@@ -306,6 +316,35 @@ get_cors_config(#httpd{cors_config = undefined}) ->
get_cors_config(#httpd{cors_config = Config}) ->
Config.
+cors_config(Host, Key, Default) ->
+ config:get(cors_section(Host), Key,
+ config:get("cors", Key, Default)).
+
+cors_section(Host0) ->
+ {Host, _Port} = split_host_port(Host0),
--- End diff --
Just a note: `couch_httpd_vhost:host/1` returns value of either
`X-Forward-Host` (as setup by apache's mod_proxy, for example) or `Host`.
Neither include scheme, not when setup by browser, at least, so `HostAsString`
is actually plain host:port string. I imagine CORS config setting as noted in
default.ini right now just doesn't work, the working config expects [cors:Host]
format.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---