fix(ipx): resolve prerender 404s for encoded filenames #1378 - #2312
fix(ipx): resolve prerender 404s for encoded filenames #1378#2312blue-rigel wants to merge 3 commits into
Conversation
commit: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe IPX URL parser now resolves relative URLs against Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The PR adjusts encoded IPX path handling and adds regression coverage; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2312 +/- ##
=======================================
Coverage 32.61% 32.61%
=======================================
Files 7 7
Lines 371 371
Branches 131 131
=======================================
Hits 121 121
Misses 194 194
Partials 56 56 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🔗 Linked issue
📚 Description
Images with filenames contain non-URL-safe characters (e.g.
+) fail duringnuxt generate/ prerender withIPX_FILE_NOT_FOUND.❌ Problem
the IPX provider correctly encodes paths (
+→%2B), but Nitro prerender appliesencodeURI()to routes, which re-encodes%(%2B→%252B). IPX then looks uptest%2Bplus.pnginstead oftest+plus.png.👍🏼 Solution
decodeURI(pathname)in the IPX routeparseURLhandler beforeparseIPXURL, so double-encoded paths resolve to the real source file. Also pass a base tonew URL()for relative request URLs.✅ Checklist
+in filenames🧪 Test plan
+in the name underpublic/<NuxtImg>nuxt generate/_ipx/.../file%2B....prerenders withoutIPX_FILE_NOT_FOUNDand lands in.output/public/_ipx/