fix(express): add empty path fallback for frontendApiProxy#8003
fix(express): add empty path fallback for frontendApiProxy#8003jacekradko wants to merge 3 commits intomainfrom
Conversation
When `frontendApiProxy.path` is set to '/', `stripTrailingSlashes` returns an empty string, causing every request to be intercepted as a proxy request. Add `|| DEFAULT_PROXY_PATH` fallback to match the existing guard in the hono and fastify packages.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: 08c1d22 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a fallback for an empty frontend API proxy path: when the configured proxy path becomes an empty string after trimming, the code uses DEFAULT_PROXY_PATH instead of the empty value. Adds tests covering this behavior and a changeset entry documenting a patch release for the clerk/express package. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
Summary
frontendApiProxy.pathin Express middlewarepathis set to'/',stripTrailingSlashesreturns'', causingpathname.startsWith('')to match every request as a proxy request|| DEFAULT_PROXY_PATHguard to match the existing pattern in@clerk/honoand@clerk/fastifyTest plan
pnpm buildpassesSummary by CodeRabbit
Bug Fixes
Tests
Documentation