SECURITY: __ws shouldn't be able to override every domain in multisite

This commit is contained in:
Daniel Waterworth 2020-09-15 10:07:03 +01:00
parent b3514ce1a3
commit 19b24e178c
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,10 @@ if Rails.env != 'development' || ENV['TRACK_REQUESTS']
end
if Rails.configuration.multisite
RailsMultisite::ConnectionManagement.asset_hostname =
GlobalSetting.cdn_origin_hostname ||
Discourse::Application.config.database_configuration[Rails.env]["host_names"].first
# Multisite needs to be first, because the request tracker and message bus rely on it
Rails.configuration.middleware.unshift RailsMultisite::Middleware, RailsMultisite::DiscoursePatches.config
Rails.configuration.middleware.delete ActionDispatch::Executor