mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-13 13:03:01 +00:00
Send CSP metrics to statsd
This commit is contained in:
@@ -512,8 +512,12 @@ class CSPReportHandler(BaseHandler):
|
|||||||
@web.authenticated
|
@web.authenticated
|
||||||
def post(self):
|
def post(self):
|
||||||
'''Log a content security policy violation report'''
|
'''Log a content security policy violation report'''
|
||||||
self.log.warning("Content security violation: %s",
|
self.log.warning(
|
||||||
self.request.body.decode('utf8', 'replace'))
|
"Content security violation: %s",
|
||||||
|
self.request.body.decode('utf8', 'replace')
|
||||||
|
)
|
||||||
|
# Report it to statsd as well
|
||||||
|
self.statsd.incr('csp_report')
|
||||||
|
|
||||||
default_handlers = [
|
default_handlers = [
|
||||||
(r'/user/([^/]+)(/.*)?', UserSpawnHandler),
|
(r'/user/([^/]+)(/.*)?', UserSpawnHandler),
|
||||||
|
Reference in New Issue
Block a user