Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | # 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. |
| 7 | See http://www.html5rocks.com/en/tutorials/security/content-security-policy/ |
| 8 | for more information on how this mechanism works. |
| 9 | """ |
| 10 | from __future__ import print_function |
| 11 | from __future__ import division |
| 12 | from __future__ import absolute_import |
| 13 | |
| 14 | import webapp2 |
| 15 | import logging |
| 16 | |
| 17 | |
| 18 | class CSPReportPage(webapp2.RequestHandler): |
| 19 | """CSPReportPage serves CSP violation reports.""" |
| 20 | |
| 21 | def post(self): |
| 22 | logging.error('CSP Violation: %s' % self.request.body) |