@@ -10,7 +10,7 @@ def StorageFileField(flask_app, url_prefix=None):
1010
1111 from flask import Blueprint , abort , jsonify , request
1212 import traceback
13- from appyter .ext .fsspec .core import url_to_fs_ex
13+ from appyter .ext .fsspec .core import url_to_chroot_fs
1414 from appyter .ext .flask import route_join_with_or_without_slash
1515
1616 blueprint = Blueprint ('StorageFileField' , __name__ )
@@ -23,8 +23,8 @@ def index():
2323 @route_join_with_or_without_slash (blueprint , 'ls' , '<path:path>' , methods = ['GET' ])
2424 def ls (path = '' ):
2525 try :
26- fs , fs_path = url_to_fs_ex (path + '#?' + request .query_string .decode ())
27- return jsonify (fs .ls (fs_path ))
26+ fs = url_to_chroot_fs (path + '#?' + request .query_string .decode ())
27+ return jsonify (fs .ls ('/' ))
2828 except KeyboardInterrupt :
2929 raise
3030 except Exception :
@@ -35,8 +35,8 @@ def ls(path=''):
3535 @route_join_with_or_without_slash (blueprint , 'info' , '<path:path>' , methods = ['GET' ])
3636 def info (path = '' ):
3737 try :
38- fs , fs_path = url_to_fs_ex (path + '#?' + request .query_string .decode ())
39- return jsonify (fs .info (fs_path ))
38+ fs = url_to_chroot_fs (path + '#?' + request .query_string .decode ())
39+ return jsonify (fs .info ('/' ))
4040 except KeyboardInterrupt :
4141 raise
4242 except Exception :
0 commit comments