mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 20:43:02 +00:00
add RouteSpec namedtuple for route specification
namedtuple(path, host) everywhere that accepts a RouteSpec must also accept a string and treat it as RouteSpec(string). RouteSpec.as_routespec(spec_or_string) handles this.
This commit is contained in:
@@ -15,7 +15,7 @@ from . import orm
|
||||
from .objects import Server
|
||||
from traitlets import HasTraits, Any, Dict, observe, default
|
||||
from .spawner import LocalProcessSpawner
|
||||
|
||||
from .proxy import RouteSpec
|
||||
|
||||
class UserDict(dict):
|
||||
"""Like defaultdict, but for users
|
||||
@@ -169,11 +169,11 @@ class User(HasTraits):
|
||||
return quote(self.name, safe='@')
|
||||
|
||||
@property
|
||||
def proxy_path(self):
|
||||
def proxy_spec(self):
|
||||
if self.settings.get('subdomain_host'):
|
||||
return url_path_join('/' + self.domain, self.base_url)
|
||||
return RouteSpec(path=self.base_url, host=self.domain)
|
||||
else:
|
||||
return self.base_url
|
||||
return RouteSpec(path=self.base_url)
|
||||
|
||||
@property
|
||||
def domain(self):
|
||||
|
Reference in New Issue
Block a user