Handle CSP Reports

This commit is contained in:
Kyle Kelley 2014-11-22 14:01:06 -06:00
parent a00d6930f2
commit 1f03954dd8
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class CSPReportHandler(IPythonHandler):
'''Accepts a content security policy violation report'''
@web.authenticated
@json_errors
def post(self):
'''Log a content security policy violation report'''
csp_report = self.get_json_body()
self.log.debug(csp_report)
csp_report_uri = r"/api/security/csp-report"
default_handlers = [
(csp_report_uri, CSPReportHandler)
]