qwik icon indicating copy to clipboard operation
qwik copied to clipboard

fix: node static files missing content-type headers

Open DustinJSilk opened this issue 2 years ago • 1 comments

What is it?

  • [ ] Feature / enhancement
  • [X] Bug
  • [ ] Docs / tests

Description

Node middleware doesn't currently set the Content-Type header on static files which can prevent files from rendering.

I've added some of the more common files extensions, taken from nginx

Use cases and why

Browsers can't always determine the mime type, also if there is aX-Content-Type-Options header present. The only way around this would be to allow MIME type sniffing which is a security risk.

Checklist:

  • [x] My code follows the developer guidelines of this project
  • [x] I have performed a self-review of my own code
  • [ ] I have made corresponding changes to the documentation
  • [ ] Added new tests to cover the fix / functionality

DustinJSilk avatar Jan 12 '23 12:01 DustinJSilk

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

thanks a lot for this @DustinJSilk ! 🙏

shairez avatar Jan 17 '23 09:01 shairez