Merge "Remove Class HTTPProxyToWSGIMiddleware"

This commit is contained in:
Jenkins 2017-09-20 20:12:55 +00:00 committed by Gerrit Code Review
commit 2e440de826
2 changed files with 2 additions and 10 deletions

View File

@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing permissions and
# limitations under the License.
from debtcollector import removals
from oslo_config import cfg
from oslo_middleware import base
@ -92,8 +91,3 @@ class HTTPProxyToWSGI(base.ConfigurableMiddleware):
v = req.environ.get("HTTP_X_FORWARDED_PREFIX")
if v:
req.environ['SCRIPT_NAME'] = v + req.environ['SCRIPT_NAME']
@removals.remove
class HTTPProxyToWSGIMiddleware(HTTPProxyToWSGI):
"""Placeholder for backward compatibility"""

View File

@ -39,8 +39,7 @@ class TestHTTPProxyToWSGI(test_base.BaseTestCase):
def fake_app(req):
return util.application_uri(req.environ)
self.middleware = http_proxy_to_wsgi.HTTPProxyToWSGIMiddleware(
fake_app)
self.middleware = http_proxy_to_wsgi.HTTPProxyToWSGI(fake_app)
response = self.request.get_response(self.middleware)
self.assertEqual(b"http://localhost:80/", response.body)
@ -119,8 +118,7 @@ class TestHTTPProxyToWSGI(test_base.BaseTestCase):
def fake_app(req):
return req.environ['REMOTE_ADDR']
self.middleware = http_proxy_to_wsgi.HTTPProxyToWSGIMiddleware(
fake_app)
self.middleware = http_proxy_to_wsgi.HTTPProxyToWSGI(fake_app)
forwarded_for_addr = '1.2.3.4'
forwarded_addr = '8.8.8.8'