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:
parent
eb572c47f8
commit
c0e54ee4de
@ -131,4 +131,4 @@ class VersionAcceptor(Router):
|
|||||||
api_controller = VersionController(app, conf)
|
api_controller = VersionController(app, conf)
|
||||||
mapper.connect(proxy_consts.VERSION_ROOT, controller=api_controller,
|
mapper.connect(proxy_consts.VERSION_ROOT, controller=api_controller,
|
||||||
conditions=dict(method=['GET']))
|
conditions=dict(method=['GET']))
|
||||||
super(VersionAcceptor, self).__init__(app, conf, mapper, None)
|
super(VersionAcceptor, self).__init__(app, conf, mapper, app)
|
||||||
|
@ -15,7 +15,9 @@
|
|||||||
|
|
||||||
from dcorch.common import consts
|
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
|
# Compute
|
||||||
FLAVOR_RESOURCE_TAG = 'flavors'
|
FLAVOR_RESOURCE_TAG = 'flavors'
|
||||||
|
Loading…
Reference in New Issue
Block a user