mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 01:06:39 +00:00
preserves the rest of the path after the matched prefix
This commit is contained in:
@@ -184,9 +184,10 @@ function createPathRewriteMiddleware(
|
|||||||
switch (rewritePathType) {
|
switch (rewritePathType) {
|
||||||
case "exact":
|
case "exact":
|
||||||
// Replace the entire path with the exact rewrite path
|
// Replace the entire path with the exact rewrite path
|
||||||
|
let exactPattern = `^${escapeRegex(path)}$`;
|
||||||
middlewares[middlewareName] = {
|
middlewares[middlewareName] = {
|
||||||
replacePathRegex: {
|
replacePathRegex: {
|
||||||
regex: "^.*$",
|
regex: exactPattern,
|
||||||
replacement: rewritePath
|
replacement: rewritePath
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user