From 8cced5011b806581eeb28cf07d20245fd4161cac Mon Sep 17 00:00:00 2001 From: Owen Date: Sat, 6 Dec 2025 21:37:10 -0500 Subject: [PATCH] Fix empty strip preventing create --- .../settings/resources/proxy/[niceId]/proxy/page.tsx | 6 +++++- src/app/[orgId]/settings/resources/proxy/create/page.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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; },