# Path: oslo_middleware/base.py
# class NoContentTypeResponse(webob.response.Response):
# class NoContentTypeRequest(webob.request.Request):
# class ConfigurableMiddleware(object):
# class Middleware(ConfigurableMiddleware):
#     def factory(cls, global_conf, **local_conf):
#         def middleware_filter(app):
#     def __init__(self, application, conf=None):
#     def _conf_get(self, key, group="oslo_middleware"):
#     def process_request(req):
#     def process_response(response, request=None):
#     def __call__(self, req):
#     def factory(cls, global_conf, **local_conf):


import copy
import logging
import debtcollector
import webob.exc
from oslo_config import cfg
from oslo_middleware import base
                                                      response=response)

        # Apply regular CORS headers.
        self._apply_cors_request_headers(request=request, response=response)

        # Finally, return the response.
        return response

    @staticmethod
    def _split_header_values(request, header_name):
        """Convert a comma-separated header value into a list of values."""
        values = []
        if header_name in request.headers:
            for value in request.headers[header_name].rsplit(','):
                value = value.strip()
                if value:
                    values.append(value)
        return values

    def _apply_cors_preflight_headers(self, request, response):
        """Handle CORS Preflight (Section 6.2)

        Given a request and a response, apply the CORS preflight headers
        appropriate for the request.
        """

        # If the response contains a 2XX code, we have to assume that the
        # underlying middleware's response content needs to be persisted.
        # Otherwise, create a new response.
        if 200 > response.status_code or response.status_code >= 300:

# Path: oslo_middleware/base.py
# class NoContentTypeResponse(webob.response.Response):
# class NoContentTypeRequest(webob.request.Request):
# class ConfigurableMiddleware(object):
# class Middleware(ConfigurableMiddleware):
#     def factory(cls, global_conf, **local_conf):
#         def middleware_filter(app):
#     def __init__(self, application, conf=None):
#     def _conf_get(self, key, group="oslo_middleware"):
#     def process_request(req):
#     def process_response(response, request=None):
#     def __call__(self, req):
#     def factory(cls, global_conf, **local_conf):


# Path: oslo_middleware/cors.py
import copy
import logging
import debtcollector
import webob.exc
from oslo_config import cfg
from oslo_middleware import base

                                                      response=response)

        # Apply regular CORS headers.
        self._apply_cors_request_headers(request=request, response=response)

        # Finally, return the response.
        return response

    @staticmethod
    def _split_header_values(request, header_name):
        """Convert a comma-separated header value into a list of values."""
        values = []
        if header_name in request.headers:
            for value in request.headers[header_name].rsplit(','):
                value = value.strip()
                if value:
                    values.append(value)
        return values

    def _apply_cors_preflight_headers(self, request, response):
        """Handle CORS Preflight (Section 6.2)

        Given a request and a response, apply the CORS preflight headers
        appropriate for the request.
        """

        # If the response contains a 2XX code, we have to assume that the
        # underlying middleware's response content needs to be persisted.
        # Otherwise, create a new response.
        if 200 > response.status_code or response.status_code >= 300:

            response = base.NoContentTypeResponse(status=webob.exc.HTTPOk.code)