fix(cloudflare): fix baseURL traversal for wrangler assets dir#4257
fix(cloudflare): fix baseURL traversal for wrangler assets dir#4257jel-massih wants to merge 1 commit into
Conversation
|
@jel-massih is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe ChangesWrangler Module Target Path Formatting
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thnx. Can you please provide reproductin steps? |
Sure! Updated PR with hopefully useful repro steps. Validated issue with basically these commands with grep output: |
"..".repeat(N)concatenates without a separator, so forN >= 2it produces"...."/"......"instead of"../.."/"../../..". With a 2+ segmentbaseURL(e.g./foo/bar),cloudflare-modulebuilds generate awrangler.jsonwhoseassets.directoryresolves to a non-existent....subdirectory, breakingwrangler deployand static asset serving.Fix:
"..".repeat(N)→"../".repeat(N)so the traversal works as expectedReproduction Steps:
Build any cloudflare-module (or cloudflare-durable) project with a baseURL of 2+ segments, e.g.:
Then check the generated .output/server/wrangler.json: assets.directory value
Before fix:
After fix: