Enabling CORS via web UI errors with 400 Bad Request, yet setting will be changed
m90 opened this issue · comments
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)
- Create a docker container using the latest version of CouchDB:
docker run -d -p 5984:5984 --name fauxton-issue couchdb
- In your browser, open http://localhost:5984/_utils/#_config/nonode@nohost/cors and press the button saying
Enable CORS
, an error should be displayed - Refresh the page in your browser to see that the CORS setting has been enabled.
Your Environment
- Version used: 2.2.0
- Browser Name and version: Chrome
- Operating System and version (desktop or mobile): Ubuntu 18.04