jupyterlab-contrib / rise

RISE: "Live" Reveal.js JupyterLab Slideshow Extension
BSD 3-Clause "New" or "Revised" License
182 stars 18 forks source link

css not loaded because of MIME type mismatch #27

Closed miguelmarco closed 7 months ago

miguelmarco commented 1 year ago

Description

If I run a local instance of jupyterlab with rise enabled, can't load custom rise.css or notebookname.css files. The console in my broser shows the error message:

The resource from  “http://localhost:8888/files//rise.css” was blocked due to a MIME type mismatch (“text/html”) (X-Content-Type-Options: nosniff).

Reproduce

  1. Install jupyterlab_risewith pip
  2. Create a simple notebook and rise.css file
  3. show the notebook with rise

Expected behavior

the rise presentation is decorated according to the rules in rise.css

Context

steff-mueller commented 1 year ago

I noticed that rise.css gets loaded successfully if one puts the notebook and rise.css into a subdirectory instead of root. Otherwise, I get the same error.

trevex commented 11 months ago

Thanks @steff-mueller using a sub-folder is indeed a workaround.

Looks like the double-slash causes the issues. Manipulating the original request from the root folder to have a single / in the path will result in successfully returning the CSS.