mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-10-15 05:31:29 +08:00
Fix files with gz extension not deflated
This commit is contained in:
parent
b1bcfabc83
commit
ce5761344d
@ -22,7 +22,7 @@
|
|||||||
#define _VERSION_ESP3D_H
|
#define _VERSION_ESP3D_H
|
||||||
|
|
||||||
//version and sources location
|
//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"
|
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
|
||||||
|
|
||||||
#endif //_VERSION_ESP3D_H
|
#endif //_VERSION_ESP3D_H
|
||||||
|
@ -42,6 +42,7 @@ void HTTP_Server:: handle_not_found()
|
|||||||
#if defined (FILESYSTEM_FEATURE)
|
#if defined (FILESYSTEM_FEATURE)
|
||||||
if(ESP_FileSystem::exists(pathWithGz.c_str()) || ESP_FileSystem::exists(path.c_str())) {
|
if(ESP_FileSystem::exists(pathWithGz.c_str()) || ESP_FileSystem::exists(path.c_str())) {
|
||||||
if(ESP_FileSystem::exists(pathWithGz.c_str())) {
|
if(ESP_FileSystem::exists(pathWithGz.c_str())) {
|
||||||
|
_webserver->sendHeader("Content-Encoding", "gzip");
|
||||||
path = pathWithGz;
|
path = pathWithGz;
|
||||||
}
|
}
|
||||||
if(!StreamFSFile(path.c_str(),contentType.c_str())) {
|
if(!StreamFSFile(path.c_str(),contentType.c_str())) {
|
||||||
@ -58,6 +59,7 @@ void HTTP_Server:: handle_not_found()
|
|||||||
pathWithGz = path + ".gz";
|
pathWithGz = path + ".gz";
|
||||||
if(ESP_FileSystem::exists(pathWithGz.c_str()) || ESP_FileSystem::exists(path.c_str())) {
|
if(ESP_FileSystem::exists(pathWithGz.c_str()) || ESP_FileSystem::exists(path.c_str())) {
|
||||||
if(ESP_FileSystem::exists(pathWithGz.c_str())) {
|
if(ESP_FileSystem::exists(pathWithGz.c_str())) {
|
||||||
|
_webserver->sendHeader("Content-Encoding", "gzip");
|
||||||
path = pathWithGz;
|
path = pathWithGz;
|
||||||
}
|
}
|
||||||
if(!StreamFSFile(path.c_str(),contentType.c_str())) {
|
if(!StreamFSFile(path.c_str(),contentType.c_str())) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user