You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2022/07/06 12:08:08 UTC

[couchdb-fauxton] branch fix-wrong-config-section-cors created (now 4c18e823)

This is an automated email from the ASF dual-hosted git repository.

ronny pushed a change to branch fix-wrong-config-section-cors
in repository https://gitbox.apache.org/repos/asf/couchdb-fauxton.git


      at 4c18e823 Fix wrong config section for `enable_cors`

This branch includes the following new commits:

     new 4c18e823 Fix wrong config section for `enable_cors`

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb-fauxton] 01/01: Fix wrong config section for `enable_cors`

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ronny pushed a commit to branch fix-wrong-config-section-cors
in repository https://gitbox.apache.org/repos/asf/couchdb-fauxton.git

commit 4c18e82350b009e7379e73b93d8ec5414fcb3f8a
Author: Ronny Berndt <ro...@apache.org>
AuthorDate: Wed Jul 6 14:07:58 2022 +0200

    Fix wrong config section for `enable_cors`
    
    Since CouchDB 3.2 enable_cors moved from section [httpd] to
    section [chttpd]. Fixes https://github.com/apache/couchdb-pkg/issues/96
---
 app/addons/cors/actions.js | 4 ++--
 app/addons/cors/api.js     | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/app/addons/cors/actions.js b/app/addons/cors/actions.js
index 6fa4b007..4d0805e0 100644
--- a/app/addons/cors/actions.js
+++ b/app/addons/cors/actions.js
@@ -16,7 +16,7 @@ import * as CorsAPI from "./api";
 
 const fetchAndLoadCORSOptions = (url, node) => (dispatch) => {
   const fetchCors = CorsAPI.fetchCORSConfig(url);
-  const fetchHttp = CorsAPI.fetchHttpdConfig(url);
+  const fetchHttp = CorsAPI.fetchChttpdConfig(url);
 
   FauxtonAPI.Promise.join(fetchCors, fetchHttp, (corsConfig, httpdConfig) => {
     const loadOptions = loadCORSOptions({
@@ -71,7 +71,7 @@ const hideDomainDeleteConfirmation = () => {
 const saveCors = (url, options) => (dispatch) => {
   const promises = [];
 
-  promises.push(CorsAPI.updateEnableCorsToHttpd(url, options.node, options.corsEnabled));
+  promises.push(CorsAPI.updateEnableCorsToChttpd(url, options.node, options.corsEnabled));
   if (options.corsEnabled) {
     promises.push(CorsAPI.updateCorsOrigins(url, options.node, sanitizeOrigins(options.origins)));
     promises.push(CorsAPI.updateCorsCredentials(url, options.node));
diff --git a/app/addons/cors/api.js b/app/addons/cors/api.js
index 3d04c60a..704875e9 100644
--- a/app/addons/cors/api.js
+++ b/app/addons/cors/api.js
@@ -29,8 +29,8 @@ export const fetchCORSConfig = (baseURL) => {
   });
 };
 
-export const fetchHttpdConfig = (baseURL) => {
-  const configURL = baseURL + '/httpd';
+export const fetchChttpdConfig = (baseURL) => {
+  const configURL = baseURL + '/chttpd';
   return get(configURL).then((json) => {
     if (json.error) {
       throw new Error(json.reason);
@@ -39,11 +39,11 @@ export const fetchHttpdConfig = (baseURL) => {
   });
 };
 
-export const updateEnableCorsToHttpd = (baseURL, node, enableCors) => {
+export const updateEnableCorsToChttpd = (baseURL, node, enableCors) => {
   if (!node) {
     throw new Error('node not set');
   }
-  const configURL = baseURL + '/httpd/enable_cors';
+  const configURL = baseURL + '/chttpd/enable_cors';
   return put(configURL, enableCors.toString())    .then((json) => {
     if (json.error) {
       throw new Error(json.reason);