perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.63k stars 1.56k forks source link

Support .mjs file MIME detection for ES6 module JavaScript #1093

Closed lawrenceching closed 5 years ago

lawrenceching commented 5 years ago

.mjs is used for JavaScript module file. It suppose to be in application/javascript same as .js file. Spark didn't support it yet and results in below error in the browser. As you can see below pic. that module.mjs was blocked by Chrome as Content-Type is application/octet-stream in the response header.

image