marcoskirsch / nodemcu-httpserver

A (very) simple web server written in Lua for the ESP8266 firmware NodeMCU.
GNU General Public License v2.0
397 stars 166 forks source link

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

Open Godzil opened 7 years ago

Godzil commented 7 years ago

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

marcoskirsch commented 7 years ago

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 commented 7 years ago

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