mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-05 02:06:41 +00:00
Fix empty strip preventing create
This commit is contained in:
@@ -179,8 +179,12 @@ const addTargetSchema = z
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// If rewritePathType is provided, rewritePath must be provided
|
// If rewritePathType is provided, rewritePath must be provided
|
||||||
|
// Exception: stripPrefix can have an empty rewritePath (to just strip the prefix)
|
||||||
if (data.rewritePathType && !data.rewritePath) {
|
if (data.rewritePathType && !data.rewritePath) {
|
||||||
return false;
|
// Allow empty rewritePath for stripPrefix type
|
||||||
|
if (data.rewritePathType !== "stripPrefix") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -190,8 +190,12 @@ const addTargetSchema = z
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// If rewritePathType is provided, rewritePath must be provided
|
// If rewritePathType is provided, rewritePath must be provided
|
||||||
|
// Exception: stripPrefix can have an empty rewritePath (to just strip the prefix)
|
||||||
if (data.rewritePathType && !data.rewritePath) {
|
if (data.rewritePathType && !data.rewritePath) {
|
||||||
return false;
|
// Allow empty rewritePath for stripPrefix type
|
||||||
|
if (data.rewritePathType !== "stripPrefix") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user