qwik
qwik copied to clipboard
fix: node static files missing content-type headers
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
Run & review this pull request in StackBlitz Codeflow.
thanks a lot for this @DustinJSilk ! 🙏