blob: 4b6f29efc7f13bf385fb7f8ba96511b354547e9e [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001# Copyright 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style
3# license that can be found in the LICENSE file or at
4# https://developers.google.com/open-source/licenses/bsd
5
6"""Servlet for Content Security Policy violation reporting.
7See http://www.html5rocks.com/en/tutorials/security/content-security-policy/
8for more information on how this mechanism works.
9"""
10from __future__ import print_function
11from __future__ import division
12from __future__ import absolute_import
13
Adrià Vilanova Martínez9f9ade52022-10-10 23:20:11 +020014import flask
Copybara854996b2021-09-07 19:36:02 +000015import logging
16
17
Adrià Vilanova Martínez9f9ade52022-10-10 23:20:11 +020018def postCsp():
Copybara854996b2021-09-07 19:36:02 +000019 """CSPReportPage serves CSP violation reports."""
Adrià Vilanova Martínez9f9ade52022-10-10 23:20:11 +020020 logging.error('CSP Violation: %s' % flask.request.get_data(as_text=True))