ovidiucp/TinyWebServer

Sometimes the webserver´s root show as plain/text

Opened this issue · 0 comments

I believe there is an error where users request the server root (without a page ou another element in the URL). The server sends page as text/plain> and not text/html

I did make some changes in code to force server send response as text/html, as you can see in this code (I added the line web_server.send_content_type("text/html");) in code bellow

I Apologize if this isn't the correct way to send this suggestion, but this is my very, very first time in GitHub

boolean index_handler(TinyWebServer& web_server) { web_server.send_error_code(200); web_server.send_content_type("text/html"); web_server.end_headers(); web_server << F("Hello World!"); return true; }