File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -601,6 +601,13 @@ def prepare(self):
601601class AuthenticatedFileHandler (IPythonHandler , web .StaticFileHandler ):
602602 """static files should only be accessible when logged in"""
603603
604+ @property
605+ def content_security_policy (self ):
606+ # In case we're serving HTML/SVG, confine any Javascript to a unique
607+ # origin so it can't interact with the notebook server.
608+ return super (AuthenticatedFileHandler , self ).content_security_policy + \
609+ "; sandbox allow-scripts"
610+
604611 @web .authenticated
605612 def get (self , path ):
606613 if os .path .splitext (path )[1 ] == '.ipynb' or self .get_argument ("download" , False ):
Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ class FilesHandler(IPythonHandler):
2626 a subclass of StaticFileHandler.
2727 """
2828
29+ @property
30+ def content_security_policy (self ):
31+ # In case we're serving HTML/SVG, confine any Javascript to a unique
32+ # origin so it can't interact with the notebook server.
33+ return super (FilesHandler , self ).content_security_policy + \
34+ "; sandbox allow-scripts"
35+
2936 @web .authenticated
3037 def head (self , path ):
3138 self .get (path , include_body = False )
You can’t perform that action at this time.
0 commit comments