From a1a76d04a82035272bf124baacea7e54f4621104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=A4lbich?= Date: Tue, 18 Feb 2020 15:25:28 +0100 Subject: [PATCH 1/2] Update NOT_ALLOWED_SSR_EXTENSIONS_REGEX to specifically look for a dot before the file extension --- config/default.json | 2 +- core/scripts/server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/default.json b/config/default.json index 209176db3b..d5ef6a0611 100644 --- a/config/default.json +++ b/config/default.json @@ -23,7 +23,7 @@ "dynamicConfigInclude": [], "elasticCacheQuota": 4096, "ssrDisabledFor": { - "extensions": [".png", ".gif", ".jpg", ".jpeg", ".woff", ".eot", ".woff2", ".ttf", ".svg", ".css", ".js", ".json", ".ico", ".tiff", ".tif", ".raw"] + "extensions": ["png", "gif", "jpg", "jpeg", "woff", "eot", "woff2", "ttf", "svg", "css", "js", "json", "ico", "tiff", "tif", "raw"] }, "trace": { "enabled": false, diff --git a/core/scripts/server.ts b/core/scripts/server.ts index 3cb9450e48..9c58a1f8c9 100755 --- a/core/scripts/server.ts +++ b/core/scripts/server.ts @@ -29,7 +29,7 @@ const compileOptions = { escape: /{{([^{][\s\S]+?[^}])}}/g, interpolate: /{{{([\s\S]+?)}}}/g } -const NOT_ALLOWED_SSR_EXTENSIONS_REGEX = new RegExp(`(.*)(${config.server.ssrDisabledFor.extensions.join('|')})$`) +const NOT_ALLOWED_SSR_EXTENSIONS_REGEX = new RegExp(`^.*\\.(${config.server.ssrDisabledFor.extensions.join('|')})$`) const isProd = process.env.NODE_ENV === 'production' process['noDeprecation'] = true From 8315f8755b8b37525fc973c377f895f8e488c011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=A4lbich?= Date: Wed, 19 Feb 2020 10:14:49 +0100 Subject: [PATCH 2/2] Update changelog to add #4100 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29f94177c2..486dd383e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - findConfigurableChildAsync - return best match for configurable variant - @gibkigonzo (#4042) - use storeCode for mappingFallback url - @gibkigonzo (#4050) - `getVariantWithLowestPrice` uses inexistent `final_price` property - @cewald (#4091) +- Fixed `NOT_ALLOWED_SSR_EXTENSIONS_REGEX` to only match with file extensions having a dot - @haelbichalex (#4100) ### Changed / Improved - Optimized `translation.processor` to process only enabled locale CSV files - @pkarw (#3950)