add CSP report handler

This commit is contained in:
Min RK
2015-07-08 12:05:02 -05:00
parent db994e09d3
commit 2c8c88ac3f
2 changed files with 38 additions and 4 deletions

View File

@@ -66,7 +66,9 @@ def api_request(app, *api_path, **kwargs):
method = kwargs.pop('method', 'get')
f = getattr(requests, method)
resp = f(url, **kwargs)
assert resp.headers['Content-Security-Policy'] == "frame-ancestors 'self'"
assert "frame-ancestors 'self'" in resp.headers['Content-Security-Policy']
assert ujoin(app.hub.server.base_url, "security/csp-report") in resp.headers['Content-Security-Policy']
assert 'http' not in resp.headers['Content-Security-Policy']
return resp
def test_auth_api(app):