diff --git a/lib/core/index.js b/lib/core/index.js index 920e55b9..953310a4 100644 --- a/lib/core/index.js +++ b/lib/core/index.js @@ -201,7 +201,7 @@ module.exports = function createMiddleware(_dir, _options) { ) ); // determine compressed forms if they were to exist - gzippedFile = `${file}.gz`; + gzippedFile = file.slice(-3) === ".gz" ? file : `${file}.gz`; brotliFile = `${file}.br`; Object.keys(headers).forEach((key) => {