Description
/api/resolvePath does not resolve home-relative paths that start with ~. A request for ~/my-preferred-dir/foo.py returns an empty resolved list even when the expanded path points to an existing file inside the server root_dir. ref: jupyterlab/jupyterlab#18875 (comment)
Reproduce
Start Jupyter Server with root_dir set to the user home directory and create ~/my-preferred-dir/foo.py. Then request /api/resolvePath?path=~%2Fmy-preferred-dir%2Ffoo.py. The response is {"resolved": []}, while requesting /api/resolvePath?path=my-preferred-dir%2Ffoo.py resolves the same file.
Expected behavior
/api/resolvePath should expand ~ before resolving the path and return the API path when the expanded file is inside root_dir, for example {"scope": "server", "path": "my-preferred-dir/foo.py"}.
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.
Description
/api/resolvePathdoes not resolve home-relative paths that start with~. A request for~/my-preferred-dir/foo.pyreturns an empty resolved list even when the expanded path points to an existing file inside the serverroot_dir. ref: jupyterlab/jupyterlab#18875 (comment)Reproduce
Start Jupyter Server with
root_dirset to the user home directory and create~/my-preferred-dir/foo.py. Then request/api/resolvePath?path=~%2Fmy-preferred-dir%2Ffoo.py. The response is {"resolved": []}, while requesting/api/resolvePath?path=my-preferred-dir%2Ffoo.pyresolves the same file.Expected behavior
/api/resolvePathshould expand~before resolving the path and return the API path when the expanded file is insideroot_dir, for example{"scope": "server", "path": "my-preferred-dir/foo.py"}.Troubleshoot Output
Command Line Output
Browser Output