added direct handle of gzipped files
This commit is contained in:
parent
5b466f7dd4
commit
bc37b48186
|
|
@ -315,8 +315,13 @@ static esp_err_t GETHandler(httpd_req_t *req)
|
||||||
file = espfs_fopen(fs, filepath);
|
file = espfs_fopen(fs, filepath);
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, "File not found");
|
strcat(filepath, ".gz"); //check if requested file in gzip archive
|
||||||
return ESP_FAIL;
|
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
|
//get file info
|
||||||
espfs_stat(fs, filepath, &stat);
|
espfs_stat(fs, filepath, &stat);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user