From e6d6a387704f68e20c1907ce5aa7325cea9f6c54 Mon Sep 17 00:00:00 2001 From: Brandon Logan Date: Wed, 12 Oct 2016 17:52:56 -0500 Subject: [PATCH] Pecan: add http_proxy_to_wsgi middleware Pecan does not currently use api paste to load middleware like the legacy wsgi, so we need to explicitly import it and wrap the pecan app. This is a follow-up to Ice9ee8f4e04050271d59858f92034c230325718b. Change-Id: I3e1b08bf1f902cf09c8a39699c00f1b0d22c3277 Closes-Bug: #1590608 --- neutron/pecan_wsgi/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/neutron/pecan_wsgi/app.py b/neutron/pecan_wsgi/app.py index 1d524d224b7..50704f37e4a 100644 --- a/neutron/pecan_wsgi/app.py +++ b/neutron/pecan_wsgi/app.py @@ -17,6 +17,7 @@ from keystonemiddleware import auth_token from neutron_lib import exceptions as n_exc from oslo_config import cfg from oslo_middleware import cors +from oslo_middleware import http_proxy_to_wsgi from oslo_middleware import request_id import pecan @@ -80,6 +81,9 @@ def _wrap_app(app): # version can be unauthenticated so it goes outside of auth app = versions.Versions(app) + # handle cases where neutron-server is behind a proxy + app = http_proxy_to_wsgi.HTTPProxyToWSGI(app) + # This should be the last middleware in the list (which results in # it being the first in the middleware chain). This is to ensure # that any errors thrown by other middleware, such as an auth