Skip to content

Commit

Permalink
Send Connection: close headers
Browse files Browse the repository at this point in the history
  • Loading branch information
IllyaMoskvin committed Sep 10, 2019
1 parent cc56b59 commit aaedb69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NixieMain/NixieMain.ino
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ void handleRoot()
{
char temp[2000];
snprintf(temp, sizeof(temp), indexHtml, apiHost, apiPath);
server.sendHeader("Connection", "close");
server.send(200, "text/html", temp);
}

Expand Down Expand Up @@ -259,6 +260,7 @@ void sendUpdate(const int code, const char *message)
{
char temp[1000];
snprintf(temp, sizeof(temp), updateHtml, message);
server.sendHeader("Connection", "close");
server.send(code, "text/html", temp);
}

Expand All @@ -276,6 +278,7 @@ void handleNotFound()
for (uint8_t i = 0; i < server.args(); i++) {
message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
}
server.sendHeader("Connection", "close");
server.send(404, "text/plain", message);
}

Expand Down
3 changes: 3 additions & 0 deletions NixieServer/NixieServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void handleRoot()
{
char temp[2000];
snprintf(temp, sizeof(temp), indexHtml, apiHost, apiPath);
server.sendHeader("Connection", "close");
server.send(200, "text/html", temp);
}

Expand Down Expand Up @@ -131,6 +132,7 @@ void sendUpdate(const int code, const char *message)
{
char temp[1000];
snprintf(temp, sizeof(temp), updateHtml, message);
server.sendHeader("Connection", "close");
server.send(code, "text/html", temp);
}

Expand All @@ -148,6 +150,7 @@ void handleNotFound()
for (uint8_t i = 0; i < server.args(); i++) {
message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
}
server.sendHeader("Connection", "close");
server.send(404, "text/plain", message);
}

Expand Down

0 comments on commit aaedb69

Please sign in to comment.