1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

add gzip content support for HTML File streaming

This commit is contained in:
ficeto 2015-05-21 14:05:00 +03:00
parent 72a3603a0c
commit 866ab26433

View File

@ -88,6 +88,13 @@ template<typename T> size_t streamFile(T &file, String contentType){
head += file.size();
head += "\r\nConnection: close";
head += "\r\nAccess-Control-Allow-Origin: *";
if(
String(file.name()).endsWith(".gz") &&
contentType != "application/x-gzip" &&
contentType != "application/octet-stream"
){
head += "\r\nContent-Encoding: gzip";
}
head += "\r\n\r\n";
_currentClient.print(head);
head = String();