ensure user's own subdomain is in trusted alt names

This commit is contained in:
Min RK
2018-10-16 15:56:54 +02:00
parent e921354544
commit 15788bec67
2 changed files with 9 additions and 2 deletions

View File

@@ -229,6 +229,12 @@ class User:
client_id = 'jupyterhub-user-%s' % quote(self.name)
if server_name:
client_id = '%s-%s' % (client_id, quote(server_name))
trusted_alt_names = []
trusted_alt_names.extend(self.settings.get('trusted_alt_names', []))
if self.settings.get('subdomain_host'):
trusted_alt_names.append('DNS:' + self.domain)
spawn_kwargs = dict(
user=self,
orm_spawner=orm_spawner,
@@ -239,7 +245,7 @@ class User:
db=self.db,
oauth_client_id=client_id,
cookie_options = self.settings.get('cookie_options', {}),
trusted_alt_names=self.settings.get('trusted_alt_names'),
trusted_alt_names=trusted_alt_names,
)
if self.settings.get('internal_ssl'):