go-aah / aah

A secure, flexible, rapid Go web framework
https://aahframework.org
MIT License
690 stars 33 forks source link

[edge] Incorrect mime-type on static content? #182

Closed pharrisee closed 6 years ago

pharrisee commented 6 years ago

Hi,

I'm getting a browser side error:

Refused to execute script from 'http://localhost:8080/static/js/aah.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

This seems to be related to this header being set:

X-Content-Type-Options: nosniff

Since that header is set to nosniff the mime-type of the static files should be set explicitly.

This is when starting the aah app in dev mode with aah r.

pharrisee commented 6 years ago

Hmm, seems the browser is requesting with a accept-content-type header = 'text/plain' , which aah then uses (correctly) to send .

More investigation required on my part.

jeevatkm commented 6 years ago

@pharrisee Okay, please let me know after your investigation then I will start analysis at my end. Is it a edge version?

jeevatkm commented 6 years ago

I have just did a small update on static file content type detection on single binary mode. You could refresh aah s -r to updates.

FYI, aah single binary does optional decompression (sends already gzipped bytes as-is from VFS) while delivering static files 😄

jeevatkm commented 6 years ago

Any insights or test results would be helpful.

jeevatkm commented 6 years ago

I have verified at my end. With previous update on edge, its doing fine.