Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes the webserver´s root show as plain/text #21

Open
fg1998 opened this issue Oct 15, 2013 · 0 comments
Open

Sometimes the webserver´s root show as plain/text #21

fg1998 opened this issue Oct 15, 2013 · 0 comments

Comments

@fg1998
Copy link

fg1998 commented Oct 15, 2013

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; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant