Request forwarding and version matching in dcorch proxy

Need to pass in the application to be the forwarder so when
the version doesn't match the request can continue down the
pipeline.  It was 'mostly' working before since the version
matching was registering all get requests as version requests
and just forwarding them, this commit also restricts that
version regex so that is no longer the case.

Change-Id: I887027a043e2a686770d4ece0ae511e00814be61
Closes-Bug: 1849831
Signed-off-by: Tyler Smith <tyler.smith@windriver.com>
This commit is contained in:
Tyler Smith 2019-10-25 17:45:02 -04:00
parent eb572c47f8
commit c0e54ee4de
2 changed files with 4 additions and 2 deletions

View File

@ -131,4 +131,4 @@ class VersionAcceptor(Router):
api_controller = VersionController(app, conf)
mapper.connect(proxy_consts.VERSION_ROOT, controller=api_controller,
conditions=dict(method=['GET']))
super(VersionAcceptor, self).__init__(app, conf, mapper, None)
super(VersionAcceptor, self).__init__(app, conf, mapper, app)

View File

@ -15,7 +15,9 @@
from dcorch.common import consts
VERSION_ROOT = '/{version:.*?}'
# Version could be any of the following: /, /v1, /v1/
# but must deny regular paths such as /v1/isystems
VERSION_ROOT = '/{version:[^/]*?(\/$)?}'
# Compute
FLAVOR_RESOURCE_TAG = 'flavors'