silx-kit / jupyterlab-h5web

A JupyterLab extension to explore and visualize HDF5 file contents. Based on https://github.com/silx-kit/h5web.
MIT License
65 stars 8 forks source link

Fixing H5Web support of filenames with special characters #46

Closed t20100 closed 3 years ago

t20100 commented 3 years ago

This PR escapes the filename in H5Web so it is safely pass through the request.

As it is, the file path displayed in h5web is also escaped so it is no really nice, but looks to work.

If you prefer to keep _check_data, I'll remove the 2nd commit.

closes #45

loichuder commented 3 years ago

Does this fix also the issue when double-clicking on a file with + in the name ?

t20100 commented 3 years ago

No, only through H5Web().

BTW, only tested with jupyterlab v2.3.1, maybe v3 solves the issue?

loichuder commented 3 years ago

BTW, only tested with jupyterlab v2.3.1, maybe v3 solves the issue?

No it doesn't.

I think we should try to find where the aggressive escaping of the URL takes place in the backend and try to circumvent it to tackle both contexts at once.

t20100 commented 3 years ago

Right! But in the network inspector the URL looks to be already escaped (i.e., + replaced with space), so maybe the filename needs to be escaped in jupyterlab before being used.

loichuder commented 3 years ago

But in the network inspector the URL looks to be already escaped (i.e., + replaced with space), so maybe the filename needs to be escaped in jupyterlab before being used.

That would be surprising as notebooks or other filetypes with + in their names work fine. That makes me think that we are perhaps doing something wrong somewhere...

t20100 commented 3 years ago

Indeed! It is supposed to work as any other file type, so the solution is maybe elsewhere...