diff --git a/jupyterhub/objects.py b/jupyterhub/objects.py index 4fd215e8..f497e904 100644 --- a/jupyterhub/objects.py +++ b/jupyterhub/objects.py @@ -166,7 +166,7 @@ class Server(HasTraits): name=self.__class__.__name__, url=self.url, bind=self.bind_url ) - def wait_up(self, timeout=10, http=False, ssl_context=None): + def wait_up(self, timeout=10, http=False, ssl_context=None, extra_path=""): """Wait for this server to come up""" if http: ssl_context = ssl_context or make_ssl_context( @@ -174,7 +174,9 @@ class Server(HasTraits): ) return wait_for_http_server( - self.url, timeout=timeout, ssl_context=ssl_context + url_path_join(self.url, extra_path), + timeout=timeout, + ssl_context=ssl_context, ) else: return wait_for_server( diff --git a/jupyterhub/user.py b/jupyterhub/user.py index fe10b7bc..e4a38f01 100644 --- a/jupyterhub/user.py +++ b/jupyterhub/user.py @@ -901,7 +901,10 @@ class User: ssl_context = make_ssl_context(key, cert, cafile=ca) try: resp = await server.wait_up( - http=True, timeout=spawner.http_timeout, ssl_context=ssl_context + http=True, + timeout=spawner.http_timeout, + ssl_context=ssl_context, + extra_path="api", ) except Exception as e: if isinstance(e, AnyTimeoutError):