Skip to content

Commit 454e3ac

Browse files
authored
avoid duplication of .gz suffix
prevents an issue where when a .gz file is requested it attempts to append an additional .gz suffix prior to checking if the file exists, i.e. the extension becomes .gz.gz
1 parent 8f7fcb0 commit 454e3ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/core/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ module.exports = function createMiddleware(_dir, _options) {
201201
)
202202
);
203203
// determine compressed forms if they were to exist
204-
gzippedFile = `${file}.gz`;
204+
gzippedFile = file.slice(-3) === ".gz" ? file : `${file}.gz`;
205205
brotliFile = `${file}.br`;
206206

207207
Object.keys(headers).forEach((key) => {

0 commit comments

Comments
 (0)