mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 05:53:00 +00:00
DEV: Allow configuration of default headers.
Applies Content-Security-Policy: frame-ancestors 'self' by default.
This commit is contained in:
@@ -60,11 +60,13 @@ def api_request(app, *api_path, **kwargs):
|
||||
|
||||
if 'Authorization' not in headers:
|
||||
headers.update(auth_header(app.db, 'admin'))
|
||||
|
||||
|
||||
url = ujoin(base_url, 'api', *api_path)
|
||||
method = kwargs.pop('method', 'get')
|
||||
f = getattr(requests, method)
|
||||
return f(url, **kwargs)
|
||||
resp = f(url, **kwargs)
|
||||
assert resp.headers['Content-Security-Policy'] == "frame-ancestors 'self'"
|
||||
return resp
|
||||
|
||||
def test_auth_api(app):
|
||||
db = app.db
|
||||
|
Reference in New Issue
Block a user