fix: fix the bug with "path.replace" not being a function when adding middleware for Express router

This commit is contained in:
Dorian Niemiec 2025-01-01 22:06:44 +01:00
parent 17188eb870
commit a8269e9057

View file

@ -99,7 +99,7 @@ function svrouter() {
} else if (middleware && typeof path !== "string") {
throw new Error("The path must be a string.");
}
const realPath = realMiddleware ? path.replace(/\/+$/, "") : "";
const realPath = middleware ? path.replace(/\/+$/, "") : "";
const callback = (req, res, logFacilities, config, next) => {
const previousReqBaseUrl = req.baseUrl;