diff --git a/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx b/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx index ba3499b5..653424f3 100644 --- a/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/[niceId]/proxy/page.tsx @@ -179,8 +179,12 @@ const addTargetSchema = z return false; } // 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) { - return false; + // Allow empty rewritePath for stripPrefix type + if (data.rewritePathType !== "stripPrefix") { + return false; + } } return true; }, diff --git a/src/app/[orgId]/settings/resources/proxy/create/page.tsx b/src/app/[orgId]/settings/resources/proxy/create/page.tsx index 5fe98c95..a5eb0301 100644 --- a/src/app/[orgId]/settings/resources/proxy/create/page.tsx +++ b/src/app/[orgId]/settings/resources/proxy/create/page.tsx @@ -190,8 +190,12 @@ const addTargetSchema = z return false; } // 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) { - return false; + // Allow empty rewritePath for stripPrefix type + if (data.rewritePathType !== "stripPrefix") { + return false; + } } return true; },