dauxio / daux.io

Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.
https://daux.io/
MIT License
791 stars 195 forks source link

handling of extension .mjs #387

Closed axelhahn closed 1 year ago

axelhahn commented 1 year ago

Describe the bug On a ssl enabled website with security header x-content-type-options: nosniff the javascript won't be loaded. It is not a bug - it should be documented in the help pages.

To Reproduce Steps to reproduce the behavior:

  1. generate static pages
  2. uplad to a ssl enabled website and htp response header x-content-type-options: nosniff
  3. open the doc pages in the browser
  4. The browser console shows The resource from “https://www.eaxemple.com/docs/themes/daux/js/main.mjs” was blocked due to MIME type (“”) mismatch (X-Content-Type-Options: nosniff).

Expected behavior The .mjs file can be interpreted as javascript.

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

My solution: The extension .mjs seems to be introduced in on of the latest versions of Daux.

In the webserver config (apache httpd) I added the type AddType application/javascript .mjs

(in .htaccess or vhost config or server config)

onigoetz commented 1 year ago

Hi, thanks for the feedback, I added a note in the documentation about this, I hope that will be enough.

Due to some external dependencies, I can't fall back to use .js on Daux. I will have a look if anything else can be done