DEV: Allow custom hosts in development mode

Rails 6 seems to introduce a whitelist of allowed hosts. I personally
use `dev.local` for development and this no longer works.

This introduces a new ENV variable, `DISCOURSE_DEV_HOST`. If present,
it will whitelist that host for development mode.
This commit is contained in:
Robin Ward 2019-09-12 13:12:06 -04:00
parent 321f559c7c
commit 95a9a544c9
1 changed files with 1 additions and 0 deletions

View File

@ -41,6 +41,7 @@ Discourse::Application.configure do
BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP']
config.load_mini_profiler = true
config.hosts << ENV['DISCOURSE_DEV_HOST'] if ENV['DISCOURSE_DEV_HOST']
require 'middleware/turbo_dev'
config.middleware.insert 0, Middleware::TurboDev