From b4e688a5432dd9a962fb23959695b3f00c1c0586 Mon Sep 17 00:00:00 2001 From: Alex Tudorache Date: Thu, 14 Jan 2016 20:29:58 +0200 Subject: [PATCH] changed template fix for web server returning empty pages in latest github --- README.md | 9 +++++++++ WiFiManager.cpp | 5 ++++- WiFiManager.h | 2 +- extras/WiFiManager.template.html | 6 +++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 986b49b..283f44a 100644 --- a/README.md +++ b/README.md @@ -251,14 +251,23 @@ The support and help I got from the community has been nothing short of phenomen __THANK YOU__ [Maximiliano Duarte](https://github.com/domonetic) + [alltheblinkythings](https://github.com/alltheblinkythings) + [Niklas Wall](https://github.com/niklaswall) + [Jakub Piasecki](https://github.com/zaporylie) + [Peter Allan](https://github.com/alwynallan) + [John Little](https://github.com/j0hnlittle) + [markaswift](https://github.com/markaswift) + [franklinvv](https://github.com/franklinvv) + [Alberto Ricci Bitti](https://github.com/riccibitti) + [SebiPanther](https://github.com/SebiPanther) Sorry if i have missed anyone. diff --git a/WiFiManager.cpp b/WiFiManager.cpp index f118517..6926ce5 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -281,6 +281,7 @@ void WiFiManager::handleRoot() { server->sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); server->sendHeader("Pragma", "no-cache"); server->sendHeader("Expires", "-1"); + server->setContentLength(CONTENT_LENGTH_UNKNOWN); server->send(200, "text/html", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves. String head = HTTP_HEAD; @@ -309,8 +310,9 @@ void WiFiManager::handleWifi(boolean scan) { server->sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); server->sendHeader("Pragma", "no-cache"); server->sendHeader("Expires", "-1"); + server->setContentLength(CONTENT_LENGTH_UNKNOWN); server->send(200, "text/html", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves. - + server->setContentLength(CONTENT_LENGTH_UNKNOWN); String head = HTTP_HEAD; head.replace("{v}", "Config ESP"); @@ -410,6 +412,7 @@ void WiFiManager::handleWifiSave() { server->sendHeader("Cache-Control", "no-cache, no-store, must-revalidate"); server->sendHeader("Pragma", "no-cache"); server->sendHeader("Expires", "-1"); + server->setContentLength(CONTENT_LENGTH_UNKNOWN); server->send(200, "text/html", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves. String head = HTTP_HEAD; diff --git a/WiFiManager.h b/WiFiManager.h index 6c82e74..03626ca 100644 --- a/WiFiManager.h +++ b/WiFiManager.h @@ -20,7 +20,7 @@ const char HTTP_200[] PROGMEM = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n"; -//const char HTTP_HEAD[] PROGMEM = "{v}"; +//const char HTTP_HEAD[] PROGMEM = "{v}"; const char HTTP_STYLE[] PROGMEM = ""; const char HTTP_SCRIPT[] PROGMEM = ""; const char HTTP_HEAD_END[] PROGMEM = "
"; diff --git a/extras/WiFiManager.template.html b/extras/WiFiManager.template.html index 4d005b2..5ef5924 100644 --- a/extras/WiFiManager.template.html +++ b/extras/WiFiManager.template.html @@ -1,5 +1,5 @@ -{v} - +{v} +
{v} {r}% {i}
@@ -7,7 +7,7 @@
Vila17 95%
LilRidingHoodz 100%
Marcelica 100%
-
PMica 110%
+
PMica 110%