Skip to content

Commit a34edc8

Browse files
committed
Merge remote-tracking branch 'remotes/ficeto/esp8266' into esp8266
2 parents b1f2fdb + 866ab26 commit a34edc8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libraries/ESP8266WebServer/src/ESP8266WebServer.h

+7
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ template<typename T> size_t streamFile(T &file, String contentType){
8888
head += file.size();
8989
head += "\r\nConnection: close";
9090
head += "\r\nAccess-Control-Allow-Origin: *";
91+
if(
92+
String(file.name()).endsWith(".gz") &&
93+
contentType != "application/x-gzip" &&
94+
contentType != "application/octet-stream"
95+
){
96+
head += "\r\nContent-Encoding: gzip";
97+
}
9198
head += "\r\n\r\n";
9299
_currentClient.print(head);
93100
head = String();

0 commit comments

Comments
 (0)