Open LoganDark opened 5 years ago
72: var fileExt = ""; 82: fileExt = path.extname(filepath).toLocaleLowerCase(); 83: var match, possibleExtensions = ["", ".html", ".htm", ".xhtml", ".php", ".svg"]; 84: if (hasNoOrigin && (possibleExtensions.indexOf(fileExt) > -1)) { 112: if (fileExt == ".wasm") { 113: res.setHeader('Content-Type', 'application/wasm'); 114: }
@Filyus Huh?
Just fixed for myself, maybe someone will come in handy.
@Filyus Pull request?
Probably.
@Filyus Probably? You're not going to make one?
I have no time. I will be grateful if you do it for me.
@Filyus You have the time to edit the code, but not to make a pull request?
Look, I have no idea what this means:
72: var fileExt = "";
82: fileExt = path.extname(filepath).toLocaleLowerCase();
83: var match, possibleExtensions = ["", ".html", ".htm", ".xhtml", ".php", ".svg"];
84: if (hasNoOrigin && (possibleExtensions.indexOf(fileExt) > -1)) {
112: if (fileExt == ".wasm") {
113: res.setHeader('Content-Type', 'application/wasm');
114: }
I finally did it.
@Filyus Thanks! I hope a maintainer won't mind adjusting the indentation though :p
Workaround: you can upgrade send
in your project, and live-server should use it.
npm i send@0.17.1 --save-dev
(latest version as of writing)
or npm i send@latest --save-dev
Make sure to restart the live-server
and do a hard refresh of your app to avoid a cached wrong-mime-type response.
Emscripten fails to load its WebAssembly due to an invalid MIME type.
live-server
returnsapplication/octet-stream
but should returnapplication/wasm
.Software details
live-server
:live-server
live-server
version: 1.2.0