Skip to content

Commit

Permalink
Update ElegantOTA.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushsharma82 authored Sep 23, 2023
1 parent b4e145a commit d0635c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ElegantOTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ void ElegantOTAClass::begin(ELEGANTOTA_WEBSERVER *server, const char * username,
return request->requestAuthentication();
}
// Post-OTA update callback
if (postUpdateCallback != NULL) postUpdateCallback(Update.hasError());
AsyncWebServerResponse *response = request->beginResponse((Update.hasError()) ? 500 : 200, "text/plain", (Update.hasError()) ? _update_error_str.c_str() : "OK");
if (postUpdateCallback != NULL) postUpdateCallback(!Update.hasError());
AsyncWebServerResponse *response = request->beginResponse((Update.hasError()) ? 400 : 200, "text/plain", (Update.hasError()) ? _update_error_str.c_str() : "OK");
response->addHeader("Connection", "close");
response->addHeader("Access-Control-Allow-Origin", "*");
request->send(response);
Expand Down

0 comments on commit d0635c7

Please sign in to comment.