From dd4f6037aea2ad64f1492c29d27010d217761021 Mon Sep 17 00:00:00 2001 From: jNullj <15849761+jNullj@users.noreply.github.com> Date: Tue, 23 Sep 2025 15:19:24 +0000 Subject: [PATCH 1/3] renamed `strict: true` to `trailing: false` --- core/base-service/route.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/base-service/route.js b/core/base-service/route.js index 7c497fc872eac..633170bccd993 100644 --- a/core/base-service/route.js +++ b/core/base-service/route.js @@ -36,7 +36,7 @@ function prepareRoute({ base, pattern, format, capture, withPng }) { const fullPattern = `${makeFullUrl(base, pattern)}:ext(${extensionRegex})` const keys = [] regex = pathToRegexp(fullPattern, keys, { - strict: true, + trailing: false, sensitive: true, }) captureNames = keys.map(item => item.name).slice(0, -1) From e2dfdb178bb3200f9eafaef16cb3616d04d73538 Mon Sep 17 00:00:00 2001 From: jNullj <15849761+jNullj@users.noreply.github.com> Date: Tue, 23 Sep 2025 16:40:10 +0000 Subject: [PATCH 2/3] update prepareRoute to inject extention regex outside of pathToRegexp context due to breaking changes in pathToRegexp that removed regex support --- core/base-service/route.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/base-service/route.js b/core/base-service/route.js index 633170bccd993..8c2e2053aa270 100644 --- a/core/base-service/route.js +++ b/core/base-service/route.js @@ -33,13 +33,19 @@ function prepareRoute({ base, pattern, format, capture, withPng }) { regex = new RegExp(`^${makeFullUrl(base, format)}(${extensionRegex})$`) captureNames = capture || [] } else { - const fullPattern = `${makeFullUrl(base, pattern)}:ext(${extensionRegex})` + const fullPatternWithoutExt = `${makeFullUrl(base, pattern)}` const keys = [] - regex = pathToRegexp(fullPattern, keys, { + const pathRegex = pathToRegexp(fullPatternWithoutExt, keys, { trailing: false, sensitive: true, }) - captureNames = keys.map(item => item.name).slice(0, -1) + const sourceWithoutEnd = pathRegex.regexp.source.replace(/\$$/, '') + // workaround for path-to-regexp not supporting regex anymore + regex = new RegExp( + `${sourceWithoutEnd}(${extensionRegex})$`, + pathRegex.regexp.flags, + ) + captureNames = keys.map(item => item.name) } return { regex, captureNames } } From 07c85ae05b45fdb8b219d5a6ab0c7332b4949776 Mon Sep 17 00:00:00 2001 From: jNullj <15849761+jNullj@users.noreply.github.com> Date: Sat, 11 Apr 2026 16:30:11 +0000 Subject: [PATCH 3/3] chore(deps): update path-to-regexp to 8.4.2 --- package-lock.json | 13 +++++++++---- package.json | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 41e7c3dd5982e..a191443a63e6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,7 @@ "mvncmp": "^1.0.0", "node-pg-migrate": "^8.0.4", "parse-link-header": "^2.0.0", - "path-to-regexp": "^6.3.0", + "path-to-regexp": "^8.4.2", "pg": "^8.20.0", "priorityqueuejs": "^2.0.0", "prom-client": "^15.1.3", @@ -25279,9 +25279,14 @@ } }, "node_modules/path-to-regexp": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz", - "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==" + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } }, "node_modules/path-type": { "version": "4.0.0", diff --git a/package.json b/package.json index a020184bd4169..aad287c0d778a 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "mvncmp": "^1.0.0", "node-pg-migrate": "^8.0.4", "parse-link-header": "^2.0.0", - "path-to-regexp": "^6.3.0", + "path-to-regexp": "^8.4.2", "pg": "^8.20.0", "priorityqueuejs": "^2.0.0", "prom-client": "^15.1.3",