MarkReedZ / mrhttp

The fastest python web framework - 8.5m requests per second!
MIT License
18 stars 6 forks source link

Support js mime type #27

Open leunga1000 opened 1 month ago

leunga1000 commented 1 month ago

Hi Mark, just starting to serve static files, wondered if there was any scope for adding mime type js?

Others I think can work with text/html but with .js got 'Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec' in the web developer console. It seems .css files will also need this too.

No biggie if not, plan is to eventually deploy UI files separately anyhow!

MarkReedZ commented 1 month ago

Thanks for noticing this. The static files is still new so there may be other issues using it as well. In production I have mrhttp behind nginx serving my static files so testing isn't that robust.

I'll fix this up on Sunday and play around a little more with the static files. Let me know if you hit other problems.

On Fri, Jul 26, 2024 at 7:26 AM leunga1000 @.***> wrote:

Hi Mark, just starting to serve static files, wondered if there was any scope for adding mime type js?

Others I think can work with text/html but with .js got 'Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec' in the web developer console. It seems .css files will also need this too.

No biggie if not, plan is to eventually deploy UI files separately anyhow!

— Reply to this email directly, view it on GitHub https://github.com/MarkReedZ/mrhttp/issues/27, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABG7JK2OPMPJY4QYT23SIPTZOJL7PAVCNFSM6AAAAABLQUBBC2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQZTEMZVHEZDEMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

leunga1000 commented 1 month ago

You know that's exactly what I will do too, have the reverse proxy rewrite the headers or directly serve the files! No major requirement from me then though I will happily test it when you get round to it. Thanks - using it for the api is already a huge boost. Have a good weekend!