fix: update response handling in setupWebserver to use beginResponse method
This commit is contained in:
1 parent
0d9132127a
commit
185cb5b081
1 file changed
+4
-2
+4
-2
@@ -130,8 +130,9 @@ void setupWebserver(AsyncWebServer &server) {
|
|||||||
Serial.println("Web: Request /waage");
|
Serial.println("Web: Request /waage");
|
||||||
String html = readFile("/waage.html");
|
String html = readFile("/waage.html");
|
||||||
html.replace("{{autoTare}}", autoTare ? "checked" : "");
|
html.replace("{{autoTare}}", autoTare ? "checked" : "");
|
||||||
AsyncWebServerResponse *response = request->send(200, "text/html", html);
|
auto response = request->beginResponse(200, "text/html", html);
|
||||||
response->addHeader("Cache-Control", NO_CACHE);
|
response->addHeader("Cache-Control", NO_CACHE);
|
||||||
|
request->send(response);
|
||||||
});
|
});
|
||||||
|
|
||||||
server.on("/setup", HTTP_GET, [](AsyncWebServerRequest *request){
|
server.on("/setup", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
@@ -139,8 +140,9 @@ void setupWebserver(AsyncWebServer &server) {
|
|||||||
String html = readFile("/setup.html");
|
String html = readFile("/setup.html");
|
||||||
html.replace("{{registered}}", filamanRegistered ? "Registered" : "Not Registered");
|
html.replace("{{registered}}", filamanRegistered ? "Registered" : "Not Registered");
|
||||||
html.replace("{{filamanUrl}}", filamanUrl);
|
html.replace("{{filamanUrl}}", filamanUrl);
|
||||||
AsyncWebServerResponse *response = request->send(200, "text/html", html);
|
auto response = request->beginResponse(200, "text/html", html);
|
||||||
response->addHeader("Cache-Control", NO_CACHE);
|
response->addHeader("Cache-Control", NO_CACHE);
|
||||||
|
request->send(response);
|
||||||
});
|
});
|
||||||
|
|
||||||
server.on("/wifi", HTTP_GET, [](AsyncWebServerRequest *request){
|
server.on("/wifi", HTTP_GET, [](AsyncWebServerRequest *request){
|
||||||
|
|||||||
Reference in new issue
Block a user