Don't replace the whole app just the wsgi_app backing
Do not replace the entire app when wrapping with middleware. It is important to maintain all the flask-functionality on the app object and ensure any/all test client calls go through the entire stack of app and middleware. Partial-Bug: #1776504 Change-Id: I928d08e96b4c79807ad8c312ba17359c54b67fa0
This commit is contained in:
parent
3330c228ad
commit
1e870abd69
|
@ -230,7 +230,7 @@ def application_factory(name='public'):
|
|||
rtr in ALL_API_ROUTERS]):
|
||||
dispatch_map['/v3/%s' % pfx] = legacy_dispatcher
|
||||
|
||||
application = KeystoneDispatcherMiddleware(
|
||||
app,
|
||||
app.wsgi_app = KeystoneDispatcherMiddleware(
|
||||
app.wsgi_app,
|
||||
dispatch_map)
|
||||
return application
|
||||
return app
|
||||
|
|
|
@ -122,10 +122,10 @@ def setup_app_middleware(app):
|
|||
# local_conf, this is all a hold-over from paste-ini and pending
|
||||
# reworking/removal(s)
|
||||
factory_func = loaded.driver.factory({}, **mw.conf)
|
||||
app = factory_func(app)
|
||||
app.wsgi_app = factory_func(app.wsgi_app)
|
||||
|
||||
# Apply werkzeug speficic middleware
|
||||
app = fixers.ProxyFix(app)
|
||||
app.wsgi_app = fixers.ProxyFix(app.wsgi_app)
|
||||
return app
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue