pgaskin / easy-novnc

Single-binary noVNC instance, web UI, and multi-host proxy.
MIT License
176 stars 60 forks source link

Javascript files should add application/javascript in response header… #10

Closed xiexiao closed 3 years ago

xiexiao commented 3 years ago

Javascript files should add application/javascript in response header in Chrome.

pgaskin commented 3 years ago

The embedded JS files are already served with the correct response header. Also, this would be the wrong place to add the header if it wasn't.

Thanks anyways!

xiexiao commented 3 years ago

Hey, I look into the code details. https://github.com/golang/go/blob/master/src/mime/type.go#L105 // On Windows, MIME types are extracted from the registry.

I run easy-novnc on Windows 10. And in the registry, the .js file set the Content Type is text/plain.

pgaskin commented 3 years ago

Some application must have done it since I can't reproduce it on my VM (the registry doesn't override the mimetype for .js).

xiexiao commented 3 years ago

I just fixed the problem by change the Content Type from text/plain to text/javascript of .js in the registry. Every thing is ok now. Thanks!