1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Update ESP8266HTTPUpdateServer.cpp

Redirect browser back to the update page after 15 seconds.
This commit is contained in:
Jacques 2016-03-02 21:24:42 +00:00
parent aa67d1c492
commit b7049ed8ee

View File

@ -34,7 +34,7 @@ void ESP8266HTTPUpdateServer::setup(ESP8266WebServer *server)
_server->on("/update", HTTP_POST, [&](){
_server->sendHeader("Connection", "close");
_server->sendHeader("Access-Control-Allow-Origin", "*");
_server->send(200, "text/plain", (Update.hasError())?"FAIL":"OK");
_server->send(200, "text/html", (Update.hasError())?"FAIL":"<META http-equiv=\"refresh\" content=\"15;URL=/update\">OK");
ESP.restart();
},[&](){
// handler for the file upload, get's the sketch bytes, and writes