preserves the rest of the path after the matched prefix

This commit is contained in:
Pallavi Kumari
2025-09-28 13:05:58 +05:30
parent 218a5ec9e4
commit 3722b67724

View File

@@ -184,9 +184,10 @@ function createPathRewriteMiddleware(
switch (rewritePathType) {
case "exact":
// Replace the entire path with the exact rewrite path
let exactPattern = `^${escapeRegex(path)}$`;
middlewares[middlewareName] = {
replacePathRegex: {
regex: "^.*$",
regex: exactPattern,
replacement: rewritePath
}
};