From 27fc1fe56fd10b60495438c10fc4fd016dc2c65e Mon Sep 17 00:00:00 2001 From: Thomas Burkhalter Date: Tue, 18 Oct 2022 10:45:07 +0200 Subject: [PATCH] Add better handling of local allowed hosts --- config/environments/development.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index d77fb6d..633e557 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -68,12 +68,13 @@ affiliate_id: ENV['ASPSMS_AFFILIATE_ID'] } + # Add allowed hosts and deduplicate them + hosts = ENV.fetch('RAILS_ALLOWED_HOSTS', '').split(',').map(&:strip) host = ENV['RAILS_HOST'] - config.hosts << host if host - + config.hosts |= hosts if hosts.present? + config.hosts |= [host] if host.present? # TODO Remove after fixing dev - config.log_level = :info config.lograge.enabled = true