'Report an instance of cache poisoning and its details'

@csrf_exempt
@validate(VRatelimit(rate_user=False, rate_ip=True, prefix='rate_poison_'), report_mac=VPrintable('report_mac', 255), poisoner_name=VPrintable('poisoner_name', 255), poisoner_id=VInt('poisoner_id'), poisoner_canary=VPrintable('poisoner_canary', 2, min_length=2), victim_canary=VPrintable('victim_canary', 2, min_length=2), render_time=VInt('render_time'), route_name=VPrintable('route_name', 255), url=VPrintable('url', 2048), source=VOneOf('source', ('web', 'mweb')), cache_policy=VOneOf('cache_policy', ('loggedin_www', 'loggedin_www_new', 'loggedin_mweb')), resp_headers=nop('resp_headers'))
def POST_report_cache_poisoning(self, report_mac, poisoner_name, poisoner_id, poisoner_canary, victim_canary, render_time, route_name, url, source, cache_policy, resp_headers):

    self.OPTIONS_report_cache_poisoning()
    if c.errors:
        abort(400)
    if (not request.headers.get('X-Loggit')):
        abort(403)
    if (poisoner_canary == victim_canary):
        abort(400)
    expected_mac = make_poisoning_report_mac(poisoner_canary=poisoner_canary, poisoner_name=poisoner_name, poisoner_id=poisoner_id, cache_policy=cache_policy, source=source, route_name=route_name)
    if (not constant_time_compare(report_mac, expected_mac)):
        abort(403)
    if resp_headers:
        try:
            resp_headers = json.loads(resp_headers)
            if (not isinstance(resp_headers, dict)):
                abort(400)
            for (hdr_name, hdr_vals) in resp_headers.iteritems():
                if (not isinstance(hdr_name, basestring)):
                    abort(400)
                if (not all((isinstance(h, basestring) for h in hdr_vals))):
                    abort(400)
        except ValueError:
            abort(400)
    if (not resp_headers):
        resp_headers = {}
    poison_info = dict(poisoner_name=poisoner_name, poisoner_id=str(poisoner_id), render_time=(render_time * 1000), route_name=route_name, url=url, source=source, cache_policy=cache_policy, resp_headers=resp_headers)
    g.stats.simple_event(('cache.poisoning.%s.%s' % (source, cache_policy)))
    g.events.cache_poisoning_event(poison_info, request=request, context=c)
    VRatelimit.ratelimit(rate_ip=True, prefix='rate_poison_', seconds=10)
    return self.api_wrapper({})
