mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
Handle CSP Reports
This commit is contained in:
parent
a00d6930f2
commit
1f03954dd8
0
IPython/html/services/security/__init__.py
Normal file
0
IPython/html/services/security/__init__.py
Normal file
17
IPython/html/services/security/handlers.py
Normal file
17
IPython/html/services/security/handlers.py
Normal 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)
|
||||
]
|
Loading…
Reference in New Issue
Block a user