jupyter-server / jupyter_server

The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications.
https://jupyter-server.readthedocs.io
BSD 3-Clause "New" or "Revised" License
492 stars 308 forks source link

Add support for custom MIME types #968

Open alec-kr opened 2 years ago

alec-kr commented 2 years ago

Problem

Support for webp images was recently added in JupyterLab. (View the PR: jupyterlab/jupyterlab#13066)

However, it was noted by @fcollonval here, that this mimetype is not supported in the Python mimetypes library used in Jupyter Server, but it is set to be released in Python 3.11.

Proposed Solution

I noticed that mimetypes.add_type('image/webp', '.webp') seems to solve this issue, by adding a custom webp mimetype. However, I am not sure where this code snippet should be implemented. I am looking for some advice, since I would like to work on this issue. I was also told that @Zsailer may be able to assist me with this.

Links

JupyterLab PR that added webp support: jupyterlab/jupyterlab#13066 cpython PR that adds webp image format: python/cpython#29259 @fcollonval's comment describing the issue

welcome[bot] commented 2 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada: