Skip to content

Commit

Permalink
serverapp: Use .absolute() instead of .resolve() for symlinks (#712)
Browse files Browse the repository at this point in the history
  • Loading branch information
EricCousineau-TRI committed Mar 9, 2022
1 parent 55d9f68 commit 426a4c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2539,9 +2539,9 @@ def _resolve_file_to_run_and_root_dir(self):
is configured, root_dir will be set to the parent
directory of file_to_run.
"""
rootdir_abspath = pathlib.Path(self.root_dir).resolve()
rootdir_abspath = pathlib.Path(self.root_dir).absolute()
file_rawpath = pathlib.Path(self.file_to_run)
combined_path = (rootdir_abspath / file_rawpath).resolve()
combined_path = (rootdir_abspath / file_rawpath).absolute()
is_child = str(combined_path).startswith(str(rootdir_abspath))

if is_child:
Expand Down

0 comments on commit 426a4c6

Please sign in to comment.