include protocol in subdomain_host

makes everything easier, and tests are passing with and without subdomains (yay!)
This commit is contained in:
Min RK
2016-02-26 17:52:31 +01:00
parent f922561003
commit 335b47d7c1
9 changed files with 25 additions and 15 deletions

View File

@@ -16,6 +16,7 @@ from datetime import datetime
from distutils.version import LooseVersion as V
from getpass import getuser
from subprocess import Popen
from urllib.parse import urlparse
if sys.version_info[:2] < (3,3):
raise ValueError("Python < 3.3 not supported: %s" % sys.version)
@@ -239,6 +240,11 @@ class JupyterHub(Application):
Only used when subdomains are involved.
"""
)
def _subdomain_host_changed(self, name, old, new):
if new and '://' not in new:
# host should include '://'
# if not specified, assume https: You have to be really explicit about HTTP!
self.subdomain_host = 'https://' + new
port = Integer(8000, config=True,
help="The public facing port of the proxy"
@@ -923,7 +929,7 @@ class JupyterHub(Application):
version_hash=datetime.now().strftime("%Y%m%d%H%M%S"),
subdomain_host = self.subdomain_host
domain = subdomain_host.rsplit(':', 1)[0]
domain = urlparse(subdomain_host).hostname
settings = dict(
log_function=log_request,
config=self.config,