m90 opened a new issue #1130: Enabling CORS via web UI errors with 400 Bad 
Request, yet setting will be changed
URL: https://github.com/apache/couchdb-fauxton/issues/1130
 
 
   <!--- Provide a general summary of the issue in the Title above -->
   
   ## Expected Behavior
   I would like to enable CORS on my local CouchDB running in a Docker 
container by pressing the corresponding button in the Fauxton UI.
   
   ## Current Behavior
   When I use the corresponding functionality in the Fauxton UI, I will get an 
error message saying
   
   ```
   Error! Could not save your CORS settings. Please try again. Reason: invalid 
UTF-8 JSON
   ```
   
   Inspecting the requests made I can see that a `PUT` request with an empty 
body against `http://localhost:5984/_node/nonode@nohost/_config/cors/origins` 
is being performed that will error out with a 400 status code and the following 
response body:
   
   ```
   {"error":"bad_request","reason":"invalid UTF-8 JSON"}
   ```
   
   Weirdly, when I refresh the page after the error has happened I will see 
that CORS has been enabled (it is also working).
   
   ## Possible Solution
   I would assume that this is due to the empty request body, yet I don't 
really know where and how this is to be fixed.
   
   ## Steps to Reproduce (for bugs)
   <!--- Provide a link to a live example, or an unambiguous set of steps to -->
   <!--- reproduce this bug. Include code to reproduce, if relevant -->
   1. Create a docker container using the latest version of CouchDB:
   
   ```
   docker run -d -p 5984:5984 --name fauxton-issue couchdb   
   ```
   
   2. In your browser, open 
<http://localhost:5984/_utils/#_config/nonode@nohost/cors> and press the button 
saying `Enable CORS`, an error should be displayed
   3. Refresh the page in your browser to see that the CORS setting has been 
enabled.
   
   ## Your Environment
   <!--- Include as many relevant details about the environment you experienced 
the bug in -->
   * Version used: 2.2.0
   * Browser Name and version: Chrome
   * Operating System and version (desktop or mobile): Ubuntu 18.04
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to