def __init__(self,
                 response=None,
                 status=None,
                 headers=None,
                 mimetype=None,
                 content_type=None,
                 direct_passthrough=False):
        headers = CaseInsensitiveDict(headers) if headers is not None else None
        if response is not None and isinstance(response, BaseResponse):
            headers = CaseInsensitiveDict(response.headers)

        if headers is None:
            headers = CaseInsensitiveDict()

        h = headers
        h['Access-Control-Allow-Origin'] = headers.get(
            'Access-Control-Allow-Origin', '*')
        h['Access-Control-Allow-Methods'] = headers.get(
            'Access-Control-Allow-Methods',
            "GET, PUT, POST, HEAD, OPTIONS, DELETE")
        h['Access-Control-Max-Age'] = headers.get('Access-Control-Max-Age',
                                                  "21600")
        h['Cache-Control'] = headers.get(
            'Cache-Control', "no-cache, must-revalidate, no-store")
        if 'Access-Control-Allow-Headers' not in headers and len(
                headers.keys()) > 0:
            h['Access-Control-Allow-Headers'] = ', '.join(headers.iterkeys())

        if response is not None and isinstance(response, BaseResponse):
            new_response_headers = CaseInsensitiveDict(
                response.headers if response.headers is not None else {})
            new_response_headers.update(h)
            response.headers = new_response_headers
            headers = None

        else:
            headers.update(h)

        super(IppResponse,
              self).__init__(response=response,
                             status=status,
                             headers=dict(headers),
                             mimetype=mimetype,
                             content_type=content_type,
                             direct_passthrough=direct_passthrough)