'Convert w3af.core.data.url.HTTPResponse.HTTPResponse  to
libmproxy.http.HTTPResponse'

def _to_libmproxy_response(self, request, response):

    charset = response.charset
    body = smart_str(response.body, charset, errors='ignore')
    header_items = []
    for (header_name, header_value) in response.headers.items():
        header_name = smart_str(header_name, charset, errors='ignore')
        header_value = smart_str(header_value, charset, errors='ignore')
        header_items.append((header_name, header_value))
    headers = ODictCaseless(header_items)
    headers['content-encoding'] = ['identity']
    return LibMITMProxyHTTPResponse(request.httpversion, response.get_code(), str(response.get_msg()), headers, body)
