Fix files with gz extension not deflated

This commit is contained in:
Luc 2020-06-16 17:00:40 +02:00
parent b1bcfabc83
commit ce5761344d
2 changed files with 3 additions and 1 deletions

View File

@ -22,7 +22,7 @@
#define _VERSION_ESP3D_H
//version and sources location
#define FW_VERSION "3.0.0.a46"
#define FW_VERSION "3.0.0.a47"
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
#endif //_VERSION_ESP3D_H

View File

@ -42,6 +42,7 @@ void HTTP_Server:: handle_not_found()
#if defined (FILESYSTEM_FEATURE)
if(ESP_FileSystem::exists(pathWithGz.c_str()) || ESP_FileSystem::exists(path.c_str())) {
if(ESP_FileSystem::exists(pathWithGz.c_str())) {
_webserver->sendHeader("Content-Encoding", "gzip");
path = pathWithGz;
}
if(!StreamFSFile(path.c_str(),contentType.c_str())) {
@ -58,6 +59,7 @@ void HTTP_Server:: handle_not_found()
pathWithGz = path + ".gz";
if(ESP_FileSystem::exists(pathWithGz.c_str()) || ESP_FileSystem::exists(path.c_str())) {
if(ESP_FileSystem::exists(pathWithGz.c_str())) {
_webserver->sendHeader("Content-Encoding", "gzip");
path = pathWithGz;
}
if(!StreamFSFile(path.c_str(),contentType.c_str())) {