Fix bug with backend_name vs backend.
This commit is contained in:
parent
2358622597
commit
c4c342c570
@ -28,12 +28,12 @@ class DomainDispatcherApplication(object):
|
|||||||
|
|
||||||
def get_backend_for_host(self, host):
|
def get_backend_for_host(self, host):
|
||||||
if self.service:
|
if self.service:
|
||||||
return BACKENDS[self.service]
|
return self.service
|
||||||
|
|
||||||
for backend in BACKENDS.itervalues():
|
for backend_name, backend in BACKENDS.iteritems():
|
||||||
for url_base in backend.url_bases:
|
for url_base in backend.url_bases:
|
||||||
if re.match(url_base, 'http://%s' % host):
|
if re.match(url_base, 'http://%s' % host):
|
||||||
return backend
|
return backend_name
|
||||||
|
|
||||||
raise RuntimeError('Invalid host: "%s"' % host)
|
raise RuntimeError('Invalid host: "%s"' % host)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user