From 5aea7eda96ce5feca9c4665d6ba75cb2d111bf71 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 10 Jun 2016 17:14:47 +0200 Subject: [PATCH] disable hub_prefix config it shouldn't be configurable --- jupyterhub/app.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/jupyterhub/app.py b/jupyterhub/app.py index 9d5ce94a..dcc025cc 100644 --- a/jupyterhub/app.py +++ b/jupyterhub/app.py @@ -356,20 +356,18 @@ class JupyterHub(Application): help="The ip for this process" ).tag(config=True) hub_prefix = URLPrefix('/hub/', - help="The prefix for the hub server. Must not be '/'" - ).tag(config=True) + help="The prefix for the hub server. Always /base_url/hub/" + ) @default('hub_prefix') def _hub_prefix_default(self): return url_path_join(self.base_url, '/hub/') - @observe('hub_prefix') - def _hub_prefix_changed(self, change): - new = change['new'] - if new == '/': - raise TraitError("'/' is not a valid hub prefix") - if not new.startswith(self.base_url): - self.hub_prefix = url_path_join(self.base_url, new) + @observe('base_url') + def _update_hub_prefix(self, change): + """add base URL to hub prefix""" + base_url = change['new'] + self.hub_prefix = self._hub_prefix_default() cookie_secret = Bytes( help="""The cookie secret to use to encrypt cookies.