Add moto reset API.
This commit is contained in:
parent
fe46b4c5b9
commit
cb28eeefbb
6 changed files with 71 additions and 3 deletions
|
|
@ -35,6 +35,9 @@ class DomainDispatcherApplication(object):
|
|||
if self.service:
|
||||
return self.service
|
||||
|
||||
if host in BACKENDS:
|
||||
return host
|
||||
|
||||
for backend_name, backend in BACKENDS.items():
|
||||
for url_base in backend.url_bases:
|
||||
if re.match(url_base, 'http://%s' % host):
|
||||
|
|
@ -43,7 +46,10 @@ class DomainDispatcherApplication(object):
|
|||
raise RuntimeError('Invalid host: "%s"' % host)
|
||||
|
||||
def get_application(self, environ):
|
||||
host = environ['HTTP_HOST'].split(':')[0]
|
||||
if environ.get('PATH_INFO', '').startswith("/moto-api"):
|
||||
host = "moto_api"
|
||||
else:
|
||||
host = environ['HTTP_HOST'].split(':')[0]
|
||||
if host == "localhost":
|
||||
# Fall back to parsing auth header to find service
|
||||
# ['Credential=sdffdsa', '20170220', 'us-east-1', 'sns', 'aws4_request']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue