You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying to use the middleware express-static-gzip.
It seems, that I found a bug. If the name of the folder containing static gzipped files contains '.gz',
no pre-compressed content will be delivered.
Steps to reproduce:
create folder "wwwroot.gzipped" in the application root
put gzpped files into the folder, e.g. test.html.gz
register the folder as express-static-gzip root folder:
app.use("/", expressStaticGzip('/wwwroot.gzipped'));
start the application, by me it works on localhost:8080
try to get http://localhost:8080/test.html
result: error 404, "Cannot GET /test.html"
Renaming the folder to "wwwroot-gzipped" helps to avoid the problem.
The error is in index.js;167
/** * Adds the compression to the file's list of available compressions * @param {string} filePath * @param {Compression} compression */functionaddCompressionToFile(filePath,compression){// !! in the next line there is an error - fileExtension is removed also from the middle of filePath !!varsrcFilePath=filePath.replace(compression.fileExtension,"").replace(rootFolder,"");varexistingFile=files[srcFilePath];if(!existingFile){files[srcFilePath]={compressions: [compression]};}else{existingFile.compressions.push(compression);}}
Hi,
I am trying to use the middleware express-static-gzip.
It seems, that I found a bug. If the name of the folder containing static gzipped files contains '.gz',
no pre-compressed content will be delivered.
Steps to reproduce:
app.use("/", expressStaticGzip('/wwwroot.gzipped'));
http://localhost:8080/test.html
Renaming the folder to "wwwroot-gzipped" helps to avoid the problem.
The error is in index.js;167
So, in the line
fileExtension is removed also from the middle of filePath :(
I am using
Best regards
yarick123
The text was updated successfully, but these errors were encountered: