Disable CORS logging by default in development (#6592)
* Disable CORS logging by default in development * Fix typos
This commit is contained in:
parent
5253ccaa75
commit
13ebedbc6d
2 changed files with 11 additions and 1 deletions
|
|
@ -61,7 +61,8 @@ module PracticalDeveloper
|
|||
|
||||
# Enable CORS for API v0
|
||||
# (logging is only activated when debug is enabled)
|
||||
config.middleware.insert_before 0, Rack::Cors, debug: Rails.env.development?, logger: (-> { Rails.logger }) do
|
||||
debug_cors = ENV["DEBUG_CORS"].present? ? true : false
|
||||
config.middleware.insert_before 0, Rack::Cors, debug: debug_cors, logger: (-> { Rails.logger }) do
|
||||
allow do
|
||||
origins do |source, _env|
|
||||
source # echo back the client's `Origin` header instead of using `*`
|
||||
|
|
|
|||
|
|
@ -80,3 +80,12 @@ end
|
|||
If instead you want to tune the Elasticsearch disk allocator's settings, please
|
||||
refer to
|
||||
[Disk-based shard allocation](https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html#disk-allocator).
|
||||
|
||||
## CORS
|
||||
|
||||
If you are experiencing CORS issues locally or need to display more information
|
||||
about the CORS headers, add the following variable to your `application.yml`:
|
||||
|
||||
```yml
|
||||
DEBUG_CORS: true
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue