fix broken send of gzipped files
This commit is contained in:
parent
89b19e8cde
commit
e46d4d7418
|
@ -357,14 +357,15 @@ void AsyncFileResponse::_setContentType(String path){
|
|||
AsyncFileResponse::AsyncFileResponse(FS &fs, String path, String contentType, bool download){
|
||||
_code = 200;
|
||||
_path = path;
|
||||
_content = fs.open(_path, "r");
|
||||
_contentLength = _content.size();
|
||||
|
||||
if(!download && !fs.exists(_path) && fs.exists(_path+".gz")){
|
||||
_path = _path+".gz";
|
||||
addHeader("Content-Encoding", "gzip");
|
||||
}
|
||||
|
||||
_content = fs.open(_path, "r");
|
||||
_contentLength = _content.size();
|
||||
|
||||
if(contentType == "")
|
||||
_setContentType(path);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue