kylepaulsen/ResourceOverride

Invalid response mime type

Closed this issue · 2 comments

orty commented

Hello,

First, thanks for this amazing extension, I use it every single day in my web development tasks at work :).

I think there might be a bug though, now when I select HTML as the file type in a URL -> File resource overriding, the response mime type is set to CSS, and when I go back to my rule it is set to 'CSS' instead of 'HTML' as well.

Best regards.

By chance are you talking about the syntax dropdown in the editor? I think the algorithm for detecting the syntax is primitive, so I probably wouldn't expect that to be super accurate. However, if you actually do get an error with mime type, you can force the mime type of your code with a special comment on the very first line:

/* mime: text/html */

If the extension sees the first line looks like that, it will remove it from the document and then force that mime. The help section mentions this near the bottom.

orty commented

Thanks for giving me that trick 🤗 I'll give it a shot and keep you posted if I encounter any further issue