added direct handle of gzipped files

This commit is contained in:
Bogdan Pilyugin 2022-11-04 15:07:01 +02:00
parent 5b466f7dd4
commit bc37b48186

View File

@ -312,12 +312,17 @@ static esp_err_t GETHandler(httpd_req_t *req)
}
//open file
file = espfs_fopen(fs, filepath);
if (!file)
{
strcat(filepath, ".gz"); //check if requested file in gzip archive
file = espfs_fopen(fs, filepath);
if (!file)
{
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, "File not found");
return ESP_FAIL;
}
}
//get file info
espfs_stat(fs, filepath, &stat);