Skip to content

Commit

Permalink
Set CSP frame-ancestors 'self' for nbgrader handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
jeflem committed Aug 26, 2024
1 parent ef44180 commit 90f8d37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nbgrader/server_extensions/formgrader/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def api(self):
api.log_level = level
return api

def initialize(self):
super().initialize()
self.set_header("Content-Security-Policy", "frame-ancestors 'self'")

def render(self, name, **ns):
template = self.settings['nbgrader_jinja2_env'].get_template(name)
return template.render(**ns)
Expand Down

0 comments on commit 90f8d37

Please sign in to comment.