Fixed #15727 -- Add support for Content-Security-Policy header support for SecurityMiddleware

I believe ``json`` raises ``ValueError`` on parsing errors, or possibly a ``RuntimeError`` if given something like:
``'{"":' * 994 + '""' + '}' * 994``.

That's just an example, but how about limiting the body size before trying to parse it and ``pprint.pformat(data, depth=3)`` before logging?