Fix scoping issue when setting the IP address #100

This commit is contained in:
Robert Strouse 2023-07-16 12:07:55 -07:00
parent 9fdf5896d1
commit f62dcef161
5 changed files with 22 additions and 4 deletions

View file

@ -1684,6 +1684,7 @@ void Web::begin() {
});
server.on("/updateFirmware", HTTP_POST, []() {
webServer.sendCORSHeaders();
somfy.transceiver.end(); // Shut down the radio so we do not get any interrupts during this process.
if(server.method() == HTTP_OPTIONS) { server.send(200, "OK"); return; }
if (Update.hasError())
server.send(500, _encoding_json, "{\"status\":\"ERROR\",\"desc\":\"Error updating firmware: \"}");
@ -1740,6 +1741,7 @@ void Web::begin() {
});
server.on("/updateApplication", HTTP_POST, []() {
webServer.sendCORSHeaders();
somfy.transceiver.end(); // Shut down the radio so we do not get any interrupts during this process.
if(server.method() == HTTP_OPTIONS) { server.send(200, "OK"); return; }
server.sendHeader("Connection", "close");
server.send(200, _encoding_json, "{\"status\":\"ERROR\",\"desc\":\"Updating Application: \"}");