You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
456 B
18 lines
456 B
#!/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)
|
|
]
|