-
Notifications
You must be signed in to change notification settings - Fork 8
Description
I notice that we introduced to set trusted host patterns for pantheon domains:
if (defined('PANTHEON_ENVIRONMENT')) {
if (in_array($_ENV['PANTHEON_ENVIRONMENT'], array('dev', 'test', 'live'))) {
$settings['trusted_host_patterns'][] = "{$_ENV['PANTHEON_ENVIRONMENT']}-{$_ENV['PANTHEON_SITE_NAME']}.pantheon.io";
$settings['trusted_host_patterns'][] = "{$_ENV['PANTHEON_ENVIRONMENT']}-{$_ENV['PANTHEON_SITE_NAME']}.pantheonsite.io";
}
}
The problem with this is that it can cause immediate downtime for live sites, after updating to the version where this was added.
From a client:
After that update the live site (that is not on the default pantheon URL) stopped working with an error, trusted_hosts_pattern. We had to add the live domain to the trusted hosts pattern to bring the site back up. Before we had not configured that at all, so i guess all URL's worked. Now not.
I think we need to add an if isset($settings['trusted_host_patterns']) before we add the pantheon domains, so that this setting remains optional for sites that didn't have any domains defined before.