mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-22 04:46:40 +00:00
Merge dev into fix/log-analytics-adjustments
This commit is contained in:
@@ -31,12 +31,17 @@ export function validatePathRewriteConfig(
|
||||
}
|
||||
|
||||
if (rewritePathType !== "stripPrefix") {
|
||||
if ((rewritePath && !rewritePathType) || (!rewritePath && rewritePathType)) {
|
||||
return { isValid: false, error: "Both rewritePath and rewritePathType must be specified together" };
|
||||
if (
|
||||
(rewritePath && !rewritePathType) ||
|
||||
(!rewritePath && rewritePathType)
|
||||
) {
|
||||
return {
|
||||
isValid: false,
|
||||
error: "Both rewritePath and rewritePathType must be specified together"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!rewritePath || !rewritePathType) {
|
||||
return { isValid: true };
|
||||
}
|
||||
@@ -68,14 +73,14 @@ export function validatePathRewriteConfig(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Additional validation for stripPrefix
|
||||
if (rewritePathType === "stripPrefix") {
|
||||
if (pathMatchType !== "prefix") {
|
||||
logger.warn(`stripPrefix rewrite type is most effective with prefix path matching. Current match type: ${pathMatchType}`);
|
||||
logger.warn(
|
||||
`stripPrefix rewrite type is most effective with prefix path matching. Current match type: ${pathMatchType}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return { isValid: true };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user