nodemcu-httpserver icon indicating copy to clipboard operation
nodemcu-httpserver copied to clipboard

Does default mimetype should not be "text/plain"?

Open Godzil opened this issue 7 years ago • 2 comments

Wouldn't be better to use a mime type like "application/octet-stream" than "text/plain" for unknown types?

https://github.com/marcoskirsch/nodemcu-httpserver/blob/28fbb6e7a7b7efe06dac092bbf0a8f8c1ae9c799/httpserver-header.lua#L18

I know that we are not going to serve really complicated thing with this server, but if the file is not text we will probably get corrupted data as the browser will expect 7bit ASCII

Godzil avatar Sep 04 '17 16:09 Godzil

I don't have a strong opinion on this. I honestly don't know what's best. Ideally nobody relies on the default.

If you serve a H or CPP or PY file from the server, you'd want text. What would you serve where you'd want octet-stream?

marcoskirsch avatar Sep 05 '17 01:09 marcoskirsch

Ok. I learned to use Google. I think your suggestion makes sense. Feel free to do a PR.

marcoskirsch avatar Sep 05 '17 01:09 marcoskirsch