Commit 5b42b3c0 authored by Eric Duminil's avatar Eric Duminil
Browse files

No String anymore. :)

parent 318eb864
...@@ -262,7 +262,9 @@ namespace web_server { ...@@ -262,7 +262,9 @@ namespace web_server {
} }
if (FS_LIB.exists(csv_writer::filename)) { if (FS_LIB.exists(csv_writer::filename)) {
fs::File csv_file = FS_LIB.open(csv_writer::filename, "r"); fs::File csv_file = FS_LIB.open(csv_writer::filename, "r");
http.sendHeader("Content-Length", String(csv_file.size())); char csv_size[10];
snprintf(csv_size, sizeof(csv_size), "%d", csv_file.size());
http.sendHeader("Content-Length", csv_size);
http.streamFile(csv_file, F("text/csv")); http.streamFile(csv_file, F("text/csv"));
csv_file.close(); csv_file.close();
} else { } else {
...@@ -274,9 +276,9 @@ namespace web_server { ...@@ -274,9 +276,9 @@ namespace web_server {
if (!shouldBeAllowed()) { if (!shouldBeAllowed()) {
return http.requestAuthentication(DIGEST_AUTH); return http.requestAuthentication(DIGEST_AUTH);
} }
Serial.print("Removing CSV file..."); Serial.print(F("Removing CSV file..."));
FS_LIB.remove(csv_writer::filename); FS_LIB.remove(csv_writer::filename);
Serial.println(" Done!"); Serial.println(F(" Done!"));
http.sendHeader("Location", "/"); http.sendHeader("Location", "/");
http.send(303); http.send(303);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment